Skip to content

Commit b38b035

Browse files
author
Thomas Johnson
authored
Merge pull request #63 from ruby-rdf/feature/tx-mutate
Tests `Transaction#mutate?`
2 parents 08b72ef + 6e30084 commit b38b035

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

lib/rdf/spec/transaction.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,26 @@
250250
end
251251
end
252252

253+
describe '#mutated?' do
254+
let(:st) { RDF::Statement(:s, RDF::URI('http://example.com/p'), 'o') }
255+
256+
it 'returns true after a successful insert' do
257+
begin
258+
expect { subject.insert(st) }
259+
.to change { subject.mutated? }.from(false).to(true)
260+
rescue NotImplementedError; end
261+
end
262+
263+
it 'returns true after a successful delete' do
264+
repository.insert(st)
265+
266+
begin
267+
expect { subject.delete(st) }
268+
.to change { subject.mutated? }.from(false).to(true)
269+
rescue NotImplementedError; end
270+
end
271+
end
272+
253273
describe '#execute' do
254274
let(:st) { RDF::Statement(:s, RDF::URI('http://example.com/p'), 'o') }
255275

0 commit comments

Comments
 (0)