spec/pragmatic_context_spec.rb in active-triples-0.4.0 vs spec/pragmatic_context_spec.rb in active-triples-0.4.1
- old
+ new
@@ -1,7 +1,8 @@
require 'spec_helper'
require 'pragmatic_context'
+require 'json/ld'
describe 'PragmaticContext integration' do
before do
class DummyLicense < ActiveTriples::Resource
include PragmaticContext::Contextualizable
@@ -39,10 +40,11 @@
g = RDF::Graph.new << JSON::LD::API.toRdf(subject.as_jsonld)
expect(subject == g).to be true
end
it 'should have contexts' do
- expect(subject.as_jsonld['@context'].keys).to eq ["license", "title"]
+ expect(subject.as_jsonld['@context'].keys)
+ .to contain_exactly("license", "title")
end
it 'should use context with dump' do
context = JSON.parse(subject.dump :jsonld)['@context']
subject.class.properties.keys.each do |prop|