Sha256: 0ce51079b74a5474fc42d71901ab28731032a80e52a0dd2c0f671ce4a27bd3c2
Contents?: true
Size: 894 Bytes
Versions: 15
Compression:
Stored size: 894 Bytes
Contents
shared_examples_for 'a relation that returns one tuple' do describe '#one' do it 'returns first tuple' do rom.relations.users.delete(name: 'Joe', email: 'joe@doe.org') expect(relation.one).to eql(name: 'Jane', email: 'jane@doe.org') end it 'raises error when there is more than one tuple' do expect { relation.one }.to raise_error(ROM::TupleCountMismatchError) end end describe '#one!' do it 'returns first tuple' do rom.relations.users.delete(name: 'Joe', email: 'joe@doe.org') expect(relation.one!).to eql(name: 'Jane', email: 'jane@doe.org') end it 'raises error when there is no tuples' do rom.relations.users.delete(name: 'Jane', email: 'jane@doe.org') rom.relations.users.delete(name: 'Joe', email: 'joe@doe.org') expect { relation.one! }.to raise_error(ROM::TupleCountMismatchError) end end end
Version data entries
15 entries across 15 versions & 1 rubygems