ruby-rdf / json-ld

Ruby JSON-LD reader/writer for RDF.rb
The Unlicense
232 stars 27 forks source link

Specs sometimes fail when fetching tests from test suite http://json-ld.org/test-suite/tests #14

Closed wmene closed 10 years ago

wmene commented 10 years ago

The method Fixtures::SuiteTest::Entry#documentLoader sometimes fails when it grabs test-suites. The content_type from the response https://github.com/ruby-rdf/json-ld/blob/develop/spec/suite_helper.rb#L256 is sometimes nil.

When content_type is nil, then the call to start_with? fails here https://github.com/ruby-rdf/json-ld/blob/develop/spec/suite_helper.rb#L266

This is the stack trace I see for one failing spec:

  135) JSON::LD test suite Transform JSON-LD to RDF toRdf-0118-in.jsonld: produce generalized RDF flag
     Failure/Error: t.run self
     NoMethodError:
       undefined method `start_with?' for nil:NilClass
     # ./spec/suite_helper.rb:266:in `block (2 levels) in documentLoader'
     # ./spec/suite_helper.rb:252:in `block in documentLoader'
     # ./spec/suite_helper.rb:250:in `documentLoader'
     # ./spec/suite_helper.rb:60:in `block (2 levels) in <class:Entry>'
     # ./spec/suite_helper.rb:121:in `run'
     # ./spec/suite_to_rdf_spec.rb:12:in `block (5 levels) in <top (required)>'
gkellogg commented 10 years ago

Thanks, my "optimized" test-suite infrastructure hid this issue from me. The server's not returning a Content-Type (which it should), and this hit that particular code.