Skip to content

Commit

Permalink
When Mutable#load is called with a base_uri option, it takes preceden…
Browse files Browse the repository at this point in the history
…ce over the resource location.
  • Loading branch information
gkellogg committed Sep 11, 2023
1 parent 4b499fe commit a331b02
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/rdf/spec/mutable.rb
Expand Up @@ -59,6 +59,12 @@
expect { subject.load(RDF::Spec::TRIPLES_FILE, **{}) }.not_to raise_error
end

it "should prefer base_uri argument over resource location" do
expect(RDF::Reader).to receive(:open)
.with(RDF::Spec::TRIPLES_FILE, base_uri: "http://example.org/location")
expect { subject.load(RDF::Spec::TRIPLES_FILE, base_uri: "http://example.org/location") }.not_to raise_error
end

it "should load statements" do
subject.load RDF::Spec::TRIPLES_FILE
expect(subject.size).to eq File.readlines(RDF::Spec::TRIPLES_FILE).size
Expand Down

0 comments on commit a331b02

Please sign in to comment.