diff --git a/lib/rdf/spec/enumerable.rb b/lib/rdf/spec/enumerable.rb index a1881fe..7b621e1 100644 --- a/lib/rdf/spec/enumerable.rb +++ b/lib/rdf/spec/enumerable.rb @@ -500,7 +500,7 @@ it {is_expected.to be_an_enumerator} it {is_expected.to be_countable} it "enumerates the same as #each_graph" do - expect(subject.to_a).to include(*enumerable.each_graph.to_a) if @supports_context # expect with match problematic + expect(subject.to_a).to include(*enumerable.each_graph.to_a) if @supports_named_graphs # expect with match problematic end end end diff --git a/lib/rdf/spec/queryable.rb b/lib/rdf/spec/queryable.rb index 0f37e83..eb33f7a 100644 --- a/lib/rdf/spec/queryable.rb +++ b/lib/rdf/spec/queryable.rb @@ -77,43 +77,7 @@ end end - context "with context", unless: RDF::VERSION.to_s >= "1.99" do - it "returns statements from all contexts with no context" do - pattern = RDF::Query::Pattern.new(nil, nil, nil, context: nil) - solutions = [] - subject.send(method, pattern) {|s| solutions << s} - expect(solutions.size).to eq @statements.size - end - - it "returns statements from unnamed contexts with false context" do - pattern = RDF::Query::Pattern.new(nil, nil, nil, context: false) - solutions = [] - subject.send(method, pattern) {|s| solutions << s} - context_statements = subject.statements.reject {|st| st.has_context?}.length - expect(solutions.size).to eq context_statements - end - - it "returns statements from named contexts with variable context" do - unless subject.contexts.to_a.empty? - pattern = RDF::Query::Pattern.new(nil, nil, nil, context: :c) - solutions = [] - subject.send(method, pattern) {|s| solutions << s} - context_statements = subject.statements.select {|st| st.has_context?}.length - expect(solutions.size).to eq context_statements - end - end - - it "returns statements from specific context with URI context" do - unless subject.contexts.to_a.empty? - pattern = RDF::Query::Pattern.new(nil, nil, nil, context: RDF::URI("http://ar.to/#self")) - solutions = [] - subject.send(method, pattern) {|s| solutions << s} - expect(solutions.size).to eq File.readlines(@doap).grep(/^/).size - end - end - end - - context "with graph_name", if: RDF::VERSION.to_s >= "1.99" do + context "with graph_name" do it "returns statements from all graphs with no graph_name" do pattern = RDF::Query::Pattern.new(nil, nil, nil, graph_name: nil) solutions = [] diff --git a/lib/rdf/spec/transaction.rb b/lib/rdf/spec/transaction.rb index 7f96c7c..933b31b 100644 --- a/lib/rdf/spec/transaction.rb +++ b/lib/rdf/spec/transaction.rb @@ -79,7 +79,7 @@ subject.execute(r) end - context 'with graph names', if: RDF::VERSION.to_s >= "1.99" do + context 'with graph names' do let(:s) {RDF::Statement.new(RDF::URI("s"), RDF::URI("p"), RDF::URI("o"))} let(:s_with_c) {RDF::Statement.new(RDF::URI("s"), RDF::URI("p"), RDF::URI("o"), graph_name: RDF::URI('c_st'))} @@ -135,7 +135,7 @@ end end - context 'with graph names', if: RDF::VERSION.to_s >= "1.99" do + context 'with graph names' do let(:s) {RDF::Statement.new(RDF::URI("s"), RDF::URI("p"), RDF::URI("o"))} let(:s_with_c) {RDF::Statement.new(RDF::URI("s"), RDF::URI("p"), RDF::URI("o"), graph_name: RDF::URI('c_st'))} diff --git a/lib/rdf/spec/writable.rb b/lib/rdf/spec/writable.rb index 473204e..be213e4 100644 --- a/lib/rdf/spec/writable.rb +++ b/lib/rdf/spec/writable.rb @@ -114,23 +114,7 @@ end end - it "should treat statements with a different context as distinct", unless: RDF::VERSION.to_s >= "1.99" do - if subject.writable? - s1 = statement.dup - s1.context = nil - s2 = statement.dup - s2.context = RDF::URI.new("urn:context:1") - s3 = statement.dup - s3.context = RDF::URI.new("urn:context:2") - subject.insert(s1) - subject.insert(s2) - subject.insert(s3) - # If contexts are not suported, all three are redundant - expect(subject.count).to eq (supports_graph_name ? 3 : 1) - end - end - - it "should treat statements with a different graph_name as distinct", if: RDF::VERSION.to_s >= "1.99" do + it "should treat statements with a different graph_name as distinct" do if subject.writable? s1 = statement.dup s1.graph_name = nil