Sha256: ed9e39567e8aea549a9e5cf4012591057a1734bc49fdb7d14ff047c7cd1e9e0f

Contents?: true

Size: 953 Bytes

Versions: 31

Compression:

Stored size: 953 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.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.json    "attrs", 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_fuzzy actual_dsl
      delta.migrate
      expect(subject.dump).to match_fuzzy expected_dsl
    }
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
ridgepole-0.7.0.beta10 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.0.beta9 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.0.beta8 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.0.beta7 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.0.beta6 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.0.beta5 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.0.beta4 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.0.beta3 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.0.beta2 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.0.beta spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.0.alpha3 spec/mysql57/json/add_json_column_spec.rb