spec/unit/relation_spec.rb in rom-sql-0.5.1 vs spec/unit/relation_spec.rb in rom-sql-0.5.2
- old
+ new
@@ -27,9 +27,16 @@
.to receive(:exclude).with(name: 'Piotr').and_call_original
expect(users.exclude(name: 'Piotr')).to_not eq(users)
end
end
+ describe '#invert' do
+ it 'delegates to dataset and returns a new relation' do
+ expect(users.dataset).to receive(:invert).and_call_original
+ expect(users.invert).to_not eq(users)
+ end
+ end
+
describe '#map' do
it 'yields tuples' do
result = []
users.map { |tuple| result << tuple }
expect(result).to eql([{ id: 1, name: 'Piotr' }])