Last active
August 29, 2015 14:05
-
-
Save no-reply/3a77af9a4188ab018459 to your computer and use it in GitHub Desktop.
Test for ActiveTriples#38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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