Skip to content

Instantly share code, notes, and snippets.

@no-reply
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save no-reply/3a77af9a4188ab018459 to your computer and use it in GitHub Desktop.
Save no-reply/3a77af9a4188ab018459 to your computer and use it in GitHub Desktop.
Test for ActiveTriples#38
before do
class DummyLicense < ActiveTriples::Resource
property :title, :predicate => RDF::DC.title
end
class DummyResource < ActiveTriples::Resource
configure :type => RDF::URI('http://example.org/SomeClass')
property :license, :predicate => RDF::DC.license, :class_name => DummyLicense
property :title, :predicate => RDF::DC.title
property :replaces, :predicate => RDF::DC.replaces
end
end
it 'should overwrite old values with no class_name' do
subject[:replaces] = DummyLicense.new.tap { |l| l.title = 'cc-by' }
license = DummyLicense.new.tap { |l| l.title = 'cc-by-nc' }
subject[:replaces] = license
expect(subject.replaces).to eq [license]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment