Sha256: e6835a52a9833da34dfb7f98693aac2b6ac53f76d4eea098ccc7336c821e6d22

Contents?: true

Size: 1019 Bytes

Versions: 11

Compression:

Stored size: 1019 Bytes

Contents

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when change column' do
    let(:actual_dsl) do
      <<-RUBY
        create_table "salaries", id: false, force: :cascade do |t|
          t.integer "emp_no", default: 0, null: false
          t.integer "salary", null: false
          t.date    "from_date", null: false
          t.date    "to_date", null: false
        end
      RUBY
    end

    let(:expected_dsl) do
      <<-RUBY
        create_table "salaries", id: false, force: :cascade do |t|
          t.integer "emp_no", null: false
          t.integer "salary", null: false
          t.date    "from_date", null: false
          t.date    "to_date", null: false
        end
      RUBY
    end

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

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ridgepole-0.8.0.rc1 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.7.7 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.7.6 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.7.5 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.7.5.beta3 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.7.5.beta2 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.7.5.beta spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.7.4 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.7.3 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.7.3.beta3 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.7.3.beta2 spec/postgresql/migrate/migrate_change_column_default_spec.rb