Sha256: 1fc5eb7f0b93675657d96f2230ef08e8d4ad86276bfca6705831e3d915a9f645
Contents?: true
Size: 779 Bytes
Versions: 31
Compression:
Stored size: 779 Bytes
Contents
shared_examples_for 'materializable relation' do describe '#each' do it 'yields objects' do count = relation.to_a.size result = [] relation.each do |object| result << object end expect(result.count).to eql(count) end it 'returns enumerator when block is not provided' do expect(relation.each.to_a).to eql(relation.to_a) end end describe '#one' do it 'returns one tuple' do expect(relation.one).to be_instance_of(Hash) end end describe '#first' do it 'returns first tuple' do expect(relation.first).to be_instance_of(Hash) end end describe '#call' do it 'materializes relation' do expect(relation.call).to be_instance_of(ROM::Relation::Loaded) end end end
Version data entries
31 entries across 31 versions & 1 rubygems