Sha256: a9953d198194809b4ccd41ca400bc1661077ffa1caf32365913ec6bad435f2d1

Contents?: true

Size: 956 Bytes

Versions: 4

Compression:

Stored size: 956 Bytes

Contents

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

describe Lhm::IdSetChunkInsert 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::IdSetChunkInsert.new(@migration, @connection, [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

4 entries across 4 versions & 1 rubygems

Version Path
lhm-teak-3.6.4 spec/integration/id_set_chunk_insert_spec.rb
lhm-teak-3.6.3 spec/integration/id_set_chunk_insert_spec.rb
lhm-teak-3.6.2 spec/integration/id_set_chunk_insert_spec.rb
lhm-teak-3.6.1 spec/integration/id_set_chunk_insert_spec.rb