Skip to content

Commit

Permalink
Add another preliminary bindings test
Browse files Browse the repository at this point in the history
  • Loading branch information
bhuga committed Dec 12, 2010
1 parent a714434 commit 0bf61f4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion spec/query_spec.rb
Expand Up @@ -314,14 +314,26 @@
end
end

it "should limit a variable to the initial bindings" do
it "limits a variable to the initial bindings" do
query = RDF::Query.new do
self << [EX.x1, EX.p, :o]
end
query.execute(@graph, :bindings => { :o => [EX.o1, EX.o4]}).should have_result_set [
{:o => EX.o1}, {:o => EX.o4}]
end

it "uses bindings for multiple variables" do
@graph << [EX.x1, EX.p1, EX.o1]
@graph << [EX.x1, EX.p1, EX.o2]
@graph << [EX.x2, EX.p1, EX.o1]
query = RDF::Query.new do
self << [:s, EX.p1, :o]
end
query.execute(@graph, :bindings => {:o => [EX.o1], :s => [EX.x1]}).should have_result_set [
{:s => EX.x1, :o => EX.o1}
]
end

end

context "solution modifiers" do
Expand Down

0 comments on commit 0bf61f4

Please sign in to comment.