spec/rdf_helper.rb in rdf-rdfxml-0.2.3 vs spec/rdf_helper.rb in rdf-rdfxml-0.3.0

- old
+ new

@@ -34,28 +34,28 @@ statements.each do |statement| next if statement.subject.is_a?(RDF::Node) pred = statement.predicate.to_s.split(/[\#\/]/).last obj = statement.object.is_a?(RDF::Literal) ? statement.object.value : statement.object.to_s - puts "#{pred}: #{obj}" if $DEBUG + puts "#{pred}: #{obj}" if ::RDF::RDFXML::debug? if statement.predicate == RDF.type self.rdf_type = obj.to_s.split(/[\#\/]/).last #puts statement.subject.to_s elsif pred =~ /Document\Z/i - puts "sub #{uri_prefix} in #{obj} for #{test_dir}" if $DEBUG + puts "sub #{uri_prefix} in #{obj} for #{test_dir}" if ::RDF::RDFXML::debug? about = obj.dup obj.sub!(uri_prefix, test_dir) - puts " => #{obj}" if $DEBUG + puts " => #{obj}" if ::RDF::RDFXML::debug? self.send("#{pred}=", obj) if pred == "inputDocument" self.about ||= about self.name ||= statement.subject.to_s.split(/[\#\/]/).last end elsif pred == "referenceOutput" - puts "referenceOutput: #{obj}" if $DEBUG + puts "referenceOutput: #{obj}" if ::RDF::RDFXML::debug? outputDocument = obj.sub(uri_prefix, test_dir) - puts "referenceOutput: " + self.send(pred) if $DEBUG + puts "referenceOutput: " + self.send(pred) if ::RDF::RDFXML::debug? elsif self.respond_to?("#{pred}=") self.send("#{pred}=", obj) end end end @@ -94,10 +94,10 @@ graph = yield(rdf_string) return unless output output_graph = RDF::Graph.load(self.outputDocument) - puts "result: #{CGI.escapeHTML(graph.to_ntriples)}" if $DEBUG + puts "result: #{CGI.escapeHTML(graph.to_ntriples)}" if ::RDF::RDFXML::debug? graph.should Matchers::be_equivalent_graph(output_graph, self) end def trace (@debug || []).to_a.join("\n")