File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments