Skip to content

Commit bb72a17

Browse files
committed
Check durability by re-creating the repository using uri and verifying that when subject is updated, the new instance is also updated. Fixes #52.
1 parent 00e7e51 commit bb72a17

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

lib/rdf/spec/durable.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,25 @@
2929

3030
it { is_expected.to respond_to(:durable?) }
3131

32-
it "is_expected.to support #durable?" do
32+
it "supports #durable?" do
3333
expect([true,false]).to be_member(subject.durable?)
3434
end
3535

3636
it {is_expected.to respond_to(:nondurable?)}
3737

38-
it "is_expected.to support #nondurable?" do
38+
it "supports #nondurable?" do
3939
expect([true,false]).to be_member(@load_durable.call.nondurable?)
4040
end
4141

4242
its(:nondurable?) {is_expected.to_not eq subject.durable?}
4343

44-
it "is_expected.to save contents between instantiations" do
44+
it "saves contents between instantiations" do
4545
if subject.durable?
46-
subject.load(RDF::Spec::TRIPLES_FILE)
47-
expect(subject.count).to eq File.readlines(RDF::Spec::TRIPLES_FILE).size
46+
new_instance = subject.class.new(subject.options.merge(uri: subject.uri))
47+
expect(new_instance).not_to be_empty
48+
subject.clear!
49+
expect(subject).to be_empty
50+
expect(new_instance).to be_empty
4851
end
4952
end
5053
end

0 commit comments

Comments
 (0)