Sha256: 09b120e4b657756e4c930776213a11b4ffee3faf8e7b8bee16aa6dd71c83a647

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

describe 'Ridgepole::Client#dump' do
  let(:actual_dsl) do
    erbh(<<-'ERB')
      create_table "books", unsigned: true, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='\"london\" bridge \"is\" falling \"down\"'" do |t|
        t.string   "title", null: false
        t.integer  "author_id", null: false
        t.datetime "created_at"
        t.datetime "updated_at"
      end
    ERB
  end

  context 'when without table options' do
    let(:expected_dsl) do
      erbh(<<-ERB)
        create_table "books", <%= i cond('>= 6.1', { id: { type: :bigint, unsigned: true } }, { id: :bigint, unsigned: true }) %>, force: :cascade, comment: "\\"london\\" bridge \\"is\\" falling \\"down\\"" do |t|
          t.string   "title", null: false
          t.integer  "author_id", null: false
          t.datetime "created_at"
          t.datetime "updated_at"
        end
      ERB
    end

    before { subject.diff(actual_dsl).migrate }
    subject { client }

    it {
      expect(subject.dump).to match_ruby expected_dsl
    }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ridgepole-0.9.5 spec/mysql/dump/dump_without_table_options_spec.rb
ridgepole-0.9.4 spec/mysql/dump/dump_without_table_options_spec.rb
ridgepole-0.9.3 spec/mysql/dump/dump_without_table_options_spec.rb
ridgepole-0.9.2 spec/mysql/dump/dump_without_table_options_spec.rb
ridgepole-0.9.1 spec/mysql/dump/dump_without_table_options_spec.rb
ridgepole-0.9.0 spec/mysql/dump/dump_without_table_options_spec.rb
ridgepole-0.9.0.rc1 spec/mysql/dump/dump_without_table_options_spec.rb