Skip to content

Commit 00e7e51

Browse files
author
Tom Johnson
committed
Add a few Snapshot tests
1 parent 1c94e3a commit 00e7e51

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

lib/rdf/spec/mutable.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@
8484
end
8585
end
8686

87+
describe '#snapshot' do
88+
it 'is implemented when #supports(:snapshots) is true' do
89+
if mutable.supports?(:snapshots)
90+
expect(mutable.snapshot).to be_a RDF::Dataset
91+
else
92+
expect { mutable.snapshot }.to raise_error NotImplementedError
93+
end
94+
end
95+
end
96+
8797
context "when updating statements" do
8898
let(:s1) { RDF::Statement(resource, RDF::URI.new("urn:predicate:1"), RDF::URI.new("urn:object:1")) }
8999
let(:s2) { RDF::Statement(resource, RDF::URI.new("urn:predicate:2"), RDF::URI.new("urn:object:2")) }

lib/rdf/spec/repository.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@
7777
end
7878
end
7979

80+
it 'has repeatable read isolation or better' do
81+
if repository.supports? :snapshots
82+
good_isolation = [:repeatable_read, :snapshot, :serializable]
83+
expect(good_isolation).to include repository.isolation_level
84+
end
85+
end
86+
8087
it 'gives an accurate snapshot' do
8188
if repository.supports? :snapshots
8289
snap = repository.snapshot

0 commit comments

Comments
 (0)