Sha256: c8e6a4ffce6c5b11418603ab194c6840eca1b93ef5cdfe2eac25d8eec9824433
Contents?: true
Size: 961 Bytes
Versions: 2
Compression:
Stored size: 961 Bytes
Contents
RSpec.describe FileStore::Reader do subject(:reader) { FileStore::Reader.new data_io, index_io } let(:data) { { one: 9000, two: 'pizza', three: ['foo', 123] } } let(:existing_event) { Event.new :tested_pizza, Time.new(2014), data } let(:data_content) { EventSerializer.serialize(existing_event) } let(:index_content) { Marshal.dump data_content.bytesize } let(:data_io) { StringIO.new(data_content, 'rb') } let(:index_io) { StringIO.new(index_content, 'rb') } describe '#read' do context 'files have stored events' do it 'should return an Enumerable of events' do result = reader.read expect(result).to respond_to :each expect(result.to_a[0]).to eq existing_event end end context 'files have no content' do let(:data_content) { '' } let(:index_content) { '' } it 'should return an empty Enumerable' do expect(reader.read.to_a).to eq [] end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
aggro-0.0.3 | spec/lib/aggro/file_store/reader_spec.rb |
aggro-0.0.2 | spec/lib/aggro/file_store/reader_spec.rb |