Sha256: 40103f4e6105d9d8f4d440ec160f64629885f677f7c9c13ab64f70d140bfea61

Contents?: true

Size: 1.03 KB

Versions: 31

Compression:

Stored size: 1.03 KB

Contents

describe 'Ridgepole::Client#diff -> migrate', condition: 5.1 do
  context 'when add virtual column' do
    let(:actual_dsl) {
      <<-EOS
        create_table "books", force: :cascade do |t|
          t.string  "title"
          t.index ["title"], name: "index_books_on_title"
        end
      EOS
    }

    let(:expected_dsl) {
      <<-EOS
        create_table "books", force: :cascade do |t|
          t.string   "title"
          t.virtual  "upper_title", type: :string, as: "upper(`title`)"
          t.virtual  "title_length", type: :integer, as: "length(`title`)", stored: true
          t.index ["title"], name: "index_books_on_title"
          t.index ["title_length"], name: "index_books_on_title_length"
        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.1 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.1.beta5 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.1.beta4 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.1.beta3 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.1.beta2 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.1.beta spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.rc1 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta22 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta21 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta20 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta19 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta18 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta17 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta16 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta15 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta14 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta13 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta12 spec/mysql57/virtual/add_virtual_column_spec.rb
ridgepole-0.7.0.beta11 spec/mysql57/virtual/add_virtual_column_spec.rb