Sha256: cb654c3d6f3aafd6b893b350ea6e03843e3dcb18ac65e055260379b2712e7156

Contents?: true

Size: 920 Bytes

Versions: 12

Compression:

Stored size: 920 Bytes

Contents

require File.expand_path(File.dirname(__FILE__)) + '/integration_helper'
require 'lhm/migration'

describe Lhm::ChunkInsert do
  include IntegrationHelper

  describe 'insert_and_return_count_of_rows_created' do
    before(:each) do
      connect_master!
      @origin = table_create(:origin)
      @destination = table_create(:destination)
      @migration = Lhm::Migration.new(@origin, @destination)
      execute("insert into origin set id = 1001")
      @connection = Lhm::Connection.new(connection: connection)
      @instance = Lhm::ChunkInsert.new(@migration, @connection, 1001, 1001)
    end

    it "returns the count" do
      assert_equal 1, @instance.insert_and_return_count_of_rows_created
    end

    it "inserts the record into the replica" do
      @instance.insert_and_return_count_of_rows_created

      replica do
        value(count_all(@destination.name)).must_equal(1)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lhm-shopify-4.5.0 spec/integration/chunk_insert_spec.rb
lhm-shopify-4.4.2 spec/integration/chunk_insert_spec.rb
lhm-shopify-4.4.1 spec/integration/chunk_insert_spec.rb
lhm-shopify-4.4.0 spec/integration/chunk_insert_spec.rb
lhm-shopify-4.3.0 spec/integration/chunk_insert_spec.rb
lhm-shopify-4.2.3 spec/integration/chunk_insert_spec.rb
lhm-shopify-4.2.2 spec/integration/chunk_insert_spec.rb
lhm-shopify-4.2.1 spec/integration/chunk_insert_spec.rb
lhm-shopify-4.2.0 spec/integration/chunk_insert_spec.rb
lhm-shopify-4.1.1 spec/integration/chunk_insert_spec.rb
lhm-shopify-4.1.0 spec/integration/chunk_insert_spec.rb
lhm-shopify-4.0.0 spec/integration/chunk_insert_spec.rb