Sha256: 64a036023e48b8ebd87f4d2dc7fc6840bc46ed45b629903d0d0eb3b15d912c38

Contents?: true

Size: 916 Bytes

Versions: 10

Compression:

Stored size: 916 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 slave" do
      @instance.insert_and_return_count_of_rows_created

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

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
lhm-teak-3.6.4 spec/integration/chunk_insert_spec.rb
lhm-teak-3.6.3 spec/integration/chunk_insert_spec.rb
lhm-teak-3.6.2 spec/integration/chunk_insert_spec.rb
lhm-teak-3.6.1 spec/integration/chunk_insert_spec.rb
lhm-teak-3.6.0 spec/integration/chunk_insert_spec.rb
lhm-shopify-3.5.5 spec/integration/chunk_insert_spec.rb
lhm-shopify-3.5.4 spec/integration/chunk_insert_spec.rb
lhm-shopify-3.5.3 spec/integration/chunk_insert_spec.rb
lhm-shopify-3.5.2 spec/integration/chunk_insert_spec.rb
lhm-shopify-3.5.1 spec/integration/chunk_insert_spec.rb