Skip to content

Commit 5dccaef

Browse files
author
Thomas Johnson
authored
Merge pull request #65 from ruby-rdf/feature/transactable-bnodes
Feature/transactable bnodes
2 parents 6a722c9 + 0acb718 commit 5dccaef

2 files changed

Lines changed: 3 additions & 30 deletions

File tree

lib/rdf/spec/repository.rb

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -48,35 +48,6 @@
4848
end
4949
end
5050

51-
describe "#transaction" do
52-
it 'gives an immutable transaction' do
53-
expect { subject.transaction { insert([]) } }.to raise_error TypeError
54-
end
55-
56-
it 'commits a successful transaction' do
57-
statement = RDF::Statement(:s, RDF.type, :o)
58-
expect(subject).to receive(:commit_transaction).and_call_original
59-
60-
expect do
61-
subject.transaction(mutable: true) { insert(statement) }
62-
end.to change { subject.statements }.to include(statement)
63-
end
64-
65-
it 'rolls back a failed transaction' do
66-
original_contents = subject.statements
67-
expect(subject).to receive(:rollback_transaction).and_call_original
68-
69-
expect do
70-
subject.transaction(mutable: true) do
71-
delete(*@statements)
72-
raise 'my error'
73-
end
74-
end.to raise_error RuntimeError
75-
76-
expect(subject.statements).to contain_exactly(*original_contents)
77-
end
78-
end
79-
8051
context "with snapshot support" do
8152

8253
describe '#snapshot' do

lib/rdf/spec/transactable.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
end
1919

2020
it 'commits a successful transaction' do
21-
statement = RDF::Statement(:s, RDF.type, :o)
21+
statement = RDF::Statement(RDF::URI('http://example.com/s'),
22+
RDF.type,
23+
RDF::URI('http://example.com/o'))
2224
expect(subject).to receive(:commit_transaction).and_call_original
2325

2426
expect do

0 commit comments

Comments
 (0)