Sha256: d2b5b92914a6f1935745a56fb5ce596ead4ababb0ef5b76506e8a7b3746d62e7

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

# coding: utf-8
$:.unshift "."
require 'spec_helper'

describe JSON::LD do
  describe "test suite" do
    require 'suite_helper'
    m = Fixtures::SuiteTest::Manifest.open("#{Fixtures::SuiteTest::SUITE}tests/fromRdf-manifest.jsonld")
    describe m.name do
      m.entries.each do |t|
        specify "#{t.property('input')}: #{t.name}" do
          begin
            t.debug = ["test: #{t.inspect}", "source: #{t.input.read}"]
            t.input.rewind
            t.debug << "result: #{t.expect.read}"
            repo = RDF::Repository.load(t.base)
            t.debug << "repo: #{repo.dump(t.id == '#t0012' ? :nquads : :trig)}"
            result = JSON::LD::API.fromRDF(repo.each_statement.to_a,
                                          :debug => t.debug)
            expected = JSON.load(t.expect)
            result.should produce(expected, t.debug)
          rescue JSON::LD::ProcessingError => e
            fail("Processing error: #{e.message}")
          rescue JSON::LD::InvalidContext => e
            fail("Invalid Context: #{e.message}")
          rescue JSON::LD::InvalidFrame => e
            fail("Invalid Frame: #{e.message}")
          end
        end
      end
    end
  end
end unless ENV['CI']

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
json-ld-1.0.5 spec/suite_from_rdf_spec.rb
json-ld-1.0.4 spec/suite_from_rdf_spec.rb
json-ld-1.0.3 spec/suite_from_rdf_spec.rb
json-ld-1.0.1.1 spec/suite_from_rdf_spec.rb
json-ld-1.0.1 spec/suite_from_rdf_spec.rb
json-ld-1.0.0 spec/suite_from_rdf_spec.rb