Sha256: f00b5a37a1dc0e2c230982e87f2ad7d14f3d3f20059617d0d063791c042e2509

Contents?: true

Size: 1.34 KB

Versions: 30

Compression:

Stored size: 1.34 KB

Contents

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when change mysql table options' do
    let(:actual_dsl) {
      erbh(<<-EOS)
        create_table "employees", primary_key: "emp_no", force: :cascade, options: "ENGINE=MyISAM DEFAULT CHARSET=utf8" do |t|
          t.date   "birth_date", null: false
          t.string "first_name", limit: 14, null: false
          t.string "last_name", limit: 16, null: false
          t.string "gender", limit: 1, null: false
          t.date   "hire_date", null: false
        end
      EOS
    }

    let(:expected_dsl) {
      erbh(<<-EOS)
        create_table "employees", primary_key: "emp_no", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=ascii" do |t|
          t.date   "birth_date", null: false
          t.string "first_name", limit: 14, null: false
          t.string "last_name", limit: 16, null: false
          t.string "gender", limit: 1, null: false
          t.date   "hire_date", null: false
        end
      EOS
    }

    before { subject.diff(actual_dsl).migrate }
    subject { client(dump_without_table_options: false, mysql_change_table_options: true) }

    it {
      delta = subject.diff(expected_dsl)
      expect(delta.differ?).to be_truthy
      expect(subject.dump).to match_fuzzy actual_dsl
      delta.migrate
      expect(subject.dump).to match_fuzzy expected_dsl
    }
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ridgepole-0.7.1 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.1.beta5 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.1.beta4 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.1.beta3 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.1.beta2 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.1.beta spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.rc1 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta22 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta21 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta20 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta19 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta18 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta17 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta16 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta15 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta14 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta13 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta12 spec/mysql/_migrate/migrate_change_table_option_spec.rb
ridgepole-0.7.0.beta11 spec/mysql/_migrate/migrate_change_table_option_spec.rb