Sha256: 7997d665c50454faf78b2e58763599916a7989ce085281c0bd37a51c0d78f62c

Contents?: true

Size: 951 Bytes

Versions: 3

Compression:

Stored size: 951 Bytes

Contents

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when add virtual column' do
    let(:actual_dsl) {
      erbh(<<-EOS)
        create_table "books", force: :cascade do |t|
          t.string  "title", null: false
          t.json    "attrs", null: false
          t.index ["title"], name: "index_books_on_title", <%= i cond(5.0, using: :btree) %>
        end
      EOS
    }

    let(:expected_dsl) {
      erbh(<<-EOS)
        create_table "books", force: :cascade do |t|
          t.string  "title", null: false
          t.index ["title"], name: "index_books_on_title", <%= i cond(5.0, using: :btree) %>
        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_ruby actual_dsl
      delta.migrate
      expect(subject.dump).to match_ruby expected_dsl
    }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ridgepole-0.7.3.beta spec/mysql57/json/drop_json_column_spec.rb
ridgepole-0.7.2 spec/mysql57/json/drop_json_column_spec.rb
ridgepole-0.7.2.beta spec/mysql57/json/drop_json_column_spec.rb