Sha256: 4cab0323643a8e382fcf6ed9f0cc12a59e22d43941690a238cbd3e13f66999d5

Contents?: true

Size: 779 Bytes

Versions: 2

Compression:

Stored size: 779 Bytes

Contents

#
#  Copyright (c) 2011, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias
#  Schmidt
#

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

require 'lhm'
require 'lhm/table'
require 'lhm/migration'

describe Lhm::Chunker do
  include IntegrationHelper

  before(:each) { connect! }

  describe "copying" do
    before(:each) do
      @origin = table_create(:origin)
      @destination = table_create(:destination)
      @migration = Lhm::Migration.new(@origin, @destination)
    end

    it "should copy 23 rows from origin to destination" do
      23.times { |n| execute("insert into origin set common = '#{ n }'") }
      Lhm::Chunker.new(@migration, limit = 23, connection).run
      count_all(@destination.name).must_equal(23)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lhm-1.0.0.rc2 spec/integration/chunker_spec.rb
lhm-1.0.0.rc.1 spec/integration/chunker_spec.rb