Sha256: 96ae9c9f2dd4e446fc2c22c111705c41e10f38cbb7a2a5f3660627fbe1125b0e

Contents?: true

Size: 630 Bytes

Versions: 13

Compression:

Stored size: 630 Bytes

Contents

require File.dirname(__FILE__) + '/base'
require 'taps/data_stream'

describe Taps::DataStream do
	before do
		@db = mock('db')
	end

	it "increments the offset" do
		stream = Taps::DataStream.new(@db, :table_name => 'test_table', :chunksize => 100)
		stream.state[:offset].should == 0
		stream.increment(100)
		stream.state[:offset].should == 100
	end

	it "marks the stream complete if no rows are fetched" do
		stream = Taps::DataStream.new(@db, :table_name => 'test_table', :chunksize => 100)
		stream.stubs(:fetch_rows).returns({})
		stream.complete?.should.be.false
		stream.fetch
		stream.complete?.should.be.true
	end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
taps-0.3.11 spec/data_stream_spec.rb
dkastner-taps-0.3.11 spec/data_stream_spec.rb
taps-0.3.10 spec/data_stream_spec.rb
taps-0.3.9 spec/data_stream_spec.rb
taps-0.3.8 spec/data_stream_spec.rb
taps-0.3.7 spec/data_stream_spec.rb
taps-0.3.6 spec/data_stream_spec.rb
taps-0.3.5 spec/data_stream_spec.rb
taps-0.3.4 spec/data_stream_spec.rb
taps-0.3.3 spec/data_stream_spec.rb
taps-0.3.2 spec/data_stream_spec.rb
taps-0.3.1 spec/data_stream_spec.rb
taps-0.3.0 spec/data_stream_spec.rb