Skip to content

Commit

Permalink
Local tests are linked from spec/rdf-tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Oct 16, 2023
1 parent 0c7c91b commit d2c65bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
3 changes: 3 additions & 0 deletions script/tc
Expand Up @@ -94,6 +94,9 @@ def run_tc(tc, **options)
result ||= "passed"
end

if options[:verbose] && result == "failed" && graph
puts "\nResult:\n" + graph.dump(:nquads)
end
rescue Interrupt => e
raise e
rescue Exception => e
Expand Down
5 changes: 1 addition & 4 deletions spec/.gitignore
@@ -1,4 +1 @@
/uri-cache/
/w3c-rdf
/w3c-rdf-tests
/w3c-rdf-star
rdf-tests
9 changes: 2 additions & 7 deletions spec/suite_helper.rb
Expand Up @@ -7,7 +7,7 @@
module RDF::Util
module File
REMOTE_PATH = "https://w3c.github.io/rdf-tests/rdf/"
LOCAL_PATH = ::File.expand_path("../w3c-rdf-tests/rdf/", __FILE__) + '/'
LOCAL_PATH = ::File.expand_path("../rdf-tests/rdf/", __FILE__) + '/'

class << self
alias_method :original_open_file, :open_file
Expand Down Expand Up @@ -111,18 +111,13 @@ def self.from_jsonld(json)

def entries
# Map entries to resources
attributes['entries'].map {|e| Entry.new(e, base_iri: attributes['baseIri'])}
attributes['entries'].map {|e| Entry.new(e)}
end
end

class Entry < JSON::LD::Resource
attr_accessor :logger

def initialize(json, base_iri:)
@base_iri = base_iri
super
end

def base
RDF::URI(@base_iri || action)
end
Expand Down

0 comments on commit d2c65bc

Please sign in to comment.