Sha256: 3f101abc1731a5917734ad1d6d01f16e1db45ecdcfb6f4c953ed265d6f1f4311

Contents?: true

Size: 988 Bytes

Versions: 17

Compression:

Stored size: 988 Bytes

Contents

# frozen_string_literal: true

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

17 entries across 17 versions & 1 rubygems

Version Path
ridgepole-0.8.13 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.9.0.beta spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.12 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.11 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.10 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.9 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.8 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.7 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.6 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.5 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.4 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.3 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.2 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.1 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.0 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.8.0.rc2 spec/mysql57/json/add_json_column_spec.rb
ridgepole-0.7.8 spec/mysql57/json/add_json_column_spec.rb