spec/active_triples/resource_spec.rb in active-triples-0.10.2 vs spec/active_triples/resource_spec.rb in active-triples-0.11.0
- old
+ new
@@ -92,11 +92,11 @@
subject.set_subject! RDF::URI('http://example.org/moomin')
end
it 'should not be settable' do
expect{ subject.set_subject! RDF::URI('http://example.org/moomin2') }
- .to raise_error 'Refusing update URI when one is already assigned!'
+ .to raise_error 'Refusing to update URI when one is already assigned!'
end
end
context 'with null relative URI subject' do
before do
@@ -340,26 +340,18 @@
subject.destroy
expect(subject).to be_empty
end
context 'with a parent' do
+ let(:parent) { DummyResource.new('http://example.org/mummi') }
+
before { parent.license = subject }
- let(:parent) do
- DummyResource.new('http://example.org/moomi')
- end
-
it 'empties the graph and removes it from the parent' do
expect { parent.license.first.destroy! }
.to change { parent.license.empty? }.to true
end
-
- it 'removes its whole graph from the parent' do
- statements = subject.statements.to_a
- parent.license.first.destroy
- statements.each { |s| expect(parent.statements).not_to include s }
- end
end
end
describe 'class_name' do
it 'should raise an error when not a class or string' do
@@ -577,24 +569,17 @@
end
context "literals are set" do
let(:literal1) { RDF::Literal.new("test", :language => :en) }
let(:literal2) { RDF::Literal.new("test", :language => :fr) }
+
before do
subject.set_value(RDF::Vocab::DC.title, [literal1, literal2])
end
- context "and literals are not requested" do
- it "should return a string" do
- # Should this de-duplicate?
- expect(subject.get_values(RDF::Vocab::DC.title))
- .to contain_exactly "test", "test"
- end
- end
- context "and literals are requested" do
- it "should return literals" do
- expect(subject.get_values(RDF::Vocab::DC.title, :literal => true))
- .to contain_exactly literal1, literal2
- end
+
+ it "should return literals" do
+ expect(subject.get_values(RDF::Vocab::DC.title, :literal => true))
+ .to contain_exactly literal1, literal2
end
end
end
describe '#[]' do