Skip to content

Commit c997f6c

Browse files
committed
Be explicit when argument is a hash and not keyword arguments.
1 parent ac5467c commit c997f6c

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

lib/rdf/spec/mutable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
if @supports_named_graphs
7070
subject.load RDF::Spec::TRIPLES_FILE, graph_name: graph_name
7171
is_expected.to have_graph(graph_name)
72-
expect(subject.query(graph_name: graph_name).size).to eq subject.size
72+
expect(subject.query({graph_name: graph_name}).size).to eq subject.size
7373
end
7474
end
7575
end

lib/rdf/spec/queryable.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@
242242

243243
it "returns the correct number of results for hash queries" do
244244
expect(subject.query({}).size).to eq @rdf_queryable_iv_statements.size
245-
expect(subject.query(subject: resource).size).to eq File.readlines(@rdf_queryable_iv_doap).grep(/^<http:\/\/rubygems\.org\/gems\/rdf>/).size
246-
expect(subject.query(subject: resource, predicate: RDF::URI("http://usefulinc.com/ns/doap#name")).size).to eq 1
247-
expect(subject.query(object: RDF::URI("http://usefulinc.com/ns/doap#Project")).size).to eq 1
245+
expect(subject.query({subject: resource}).size).to eq File.readlines(@rdf_queryable_iv_doap).grep(/^<http:\/\/rubygems\.org\/gems\/rdf>/).size
246+
expect(subject.query({subject: resource, predicate: RDF::URI("http://usefulinc.com/ns/doap#name")}).size).to eq 1
247+
expect(subject.query({object: RDF::URI("http://usefulinc.com/ns/doap#Project")}).size).to eq 1
248248
end
249249

250250
it "returns the correct number of results for query queries" do
@@ -256,13 +256,13 @@
256256
context "with specific patterns from SPARQL" do
257257
context "triple pattern combinations" do
258258
it "?s p o" do
259-
expect(subject.query(predicate: RDF::URI("http://example.org/p"), object: RDF::Literal.new(1)).to_a).to(
259+
expect(subject.query({predicate: RDF::URI("http://example.org/p"), object: RDF::Literal.new(1)}).to_a).to(
260260
include *[RDF::Statement.new(RDF::URI("http://example.org/xi1"), RDF::URI("http://example.org/p"), 1), RDF::Statement.new(RDF::URI("http://example.org/xi2"), RDF::URI("http://example.org/p"), 1)]
261261
)
262262
end
263263

264264
it "s ?p o" do
265-
expect(subject.query(subject: RDF::URI("http://example.org/xi2"), object: RDF::Literal.new(1)).to_a).to(
265+
expect(subject.query({subject: RDF::URI("http://example.org/xi2"), object: RDF::Literal.new(1)}).to_a).to(
266266
include *[RDF::Statement.new(RDF::URI("http://example.org/xi2"), RDF::URI("http://example.org/p"), 1)]
267267
)
268268
end
@@ -272,8 +272,8 @@
272272
context "data/r2/expr-equals" do
273273
context "graph-1" do
274274
let(:result) do
275-
queryable.query(predicate: RDF::URI("http://example.org/p"),
276-
object: RDF::Literal::Integer.new(1)).to_a
275+
queryable.query({predicate: RDF::URI("http://example.org/p"),
276+
object: RDF::Literal::Integer.new(1)}).to_a
277277
end
278278

279279
it 'has two solutions' do
@@ -293,8 +293,8 @@
293293

294294
context "graph-2" do
295295
let(:result) do
296-
queryable.query(predicate: RDF::URI("http://example.org/p"),
297-
object: RDF::Literal::Double.new("1.0e0"))
296+
queryable.query({predicate: RDF::URI("http://example.org/p"),
297+
object: RDF::Literal::Double.new("1.0e0")})
298298
.to_a
299299
end
300300

0 commit comments

Comments
 (0)