Sha256: 45a3fe53d8e1f0816c8b4ddc3f5dc56459eff44fca53bafa0e1eed2f1db37112

Contents?: true

Size: 1.11 KB

Versions: 11

Compression:

Stored size: 1.11 KB

Contents

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when add bigint column' do
    let(:actual_dsl) { '' }

    let(:expected_dsl) do
      erbh(<<-ERB)
        create_table "bigint_test", id: false, force: :cascade do |t|
          t.bigint "b"
        end
      ERB
    end

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

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

  context 'when no change' do
    let(:dsl) do
      erbh(<<-ERB)
        create_table "bigint_test", id: false, force: :cascade do |t|
          t.bigint "b"
        end
      ERB
    end

    let(:expected_dsl) do
      erbh(<<-ERB)
        create_table "bigint_test", id: false, force: :cascade do |t|
          t.bigint "b"
        end
      ERB
    end

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

    it {
      delta = subject.diff(expected_dsl)
      expect(delta.differ?).to be_falsey
      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_bigint_spec.rb
ridgepole-0.7.7 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.6 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.5 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.5.beta3 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.5.beta2 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.5.beta spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.4 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.3 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.3.beta3 spec/postgresql/migrate/migrate_bigint_spec.rb
ridgepole-0.7.3.beta2 spec/postgresql/migrate/migrate_bigint_spec.rb