Sha256: d0781de0f57ed95009ada098b2c8f191cf2a78a9a5c263a01ede6fad23213411

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 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/compact-manifest.jsonld")
    describe m.name do
      m.entries.each do |t|
        specify "#{t.property('input')}: #{t.name}" do
          begin
            #case t.property('input')
            #when /compact-(0032|0033|0034)/
            #  pending("undesireable property generator corner cases")
            #end
            t.debug = ["test: #{t.inspect}", "source: #{t.input.read}"]
            if t.property('context')
              t.debug << "context: #{t.context.read}"
              t.context.rewind
            end
            result = JSON::LD::API.compact(t.input, t.context,
                                          :base => t.base,
                                          :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

3 entries across 3 versions & 1 rubygems

Version Path
json-ld-1.0.1.1 spec/suite_compact_spec.rb
json-ld-1.0.1 spec/suite_compact_spec.rb
json-ld-1.0.0 spec/suite_compact_spec.rb