Sha256: 44713535b397396fd9cf9ee924594f24c7d34500eefd173b5e2dd32080e95034

Contents?: true

Size: 1.04 KB

Versions: 20

Compression:

Stored size: 1.04 KB

Contents

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when change column' do
    let(:actual_dsl) {
      <<-EOS
        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
      EOS
    }

    let(:expected_dsl) {
      <<-EOS
        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
      EOS
    }

    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_fuzzy actual_dsl
      delta.migrate
      expect(subject.dump).to match_fuzzy expected_dsl
    }
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ridgepole-0.6.6 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.6.beta3 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.7.0.alpha spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.6.beta2 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.6.beta spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta14 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta13 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta12 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta11 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta10 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta9 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta8 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta7 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta6 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta5 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta4 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta3 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta2 spec/postgresql/migrate/migrate_change_column_default_spec.rb
ridgepole-0.6.5.beta spec/postgresql/migrate/migrate_change_column_default_spec.rb