Sha256: ae444d4d5157ce2c71659065ac6223fa6a7f3c26f603b842376f2aec33917fec

Contents?: true

Size: 957 Bytes

Versions: 11

Compression:

Stored size: 957 Bytes

Contents

describe 'Ridgepole::Client#diff -> migrate' do
  context 'when add virtual column' do
    let(:actual_dsl) do
      erbh(<<-ERB)
        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
      ERB
    end

    let(:expected_dsl) do
      erbh(<<-ERB)
        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
      ERB
    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/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.7 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.6 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.5 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.5.beta3 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.5.beta2 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.5.beta spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.4 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.3 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.3.beta3 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.3.beta2 spec/mysql57/json/add_json_column_spec.rb