Sha256: e8035e82bc143e2414b9048f9d48a0b1e863ff6fec345441ab8a06d1308814b8

Contents?: true

Size: 644 Bytes

Versions: 11

Compression:

Stored size: 644 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

11 entries across 11 versions & 1 rubygems

Version Path
taps2-0.6.10 spec/data_stream_spec.rb
taps2-0.6.9 spec/data_stream_spec.rb
taps2-0.6.8 spec/data_stream_spec.rb
taps2-0.6.7 spec/data_stream_spec.rb
taps2-0.6.6 spec/data_stream_spec.rb
taps2-0.6.5 spec/data_stream_spec.rb
taps2-0.6.4 spec/data_stream_spec.rb
taps2-0.6.3 spec/data_stream_spec.rb
taps2-0.6.2 spec/data_stream_spec.rb
taps2-0.6.1 spec/data_stream_spec.rb
taps2-0.6.0 spec/data_stream_spec.rb