Skip to content

Commit

Permalink
Add test [fixup]
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Johnson committed Jul 8, 2015
1 parent 6d75344 commit 896e890
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion spec/active_triples/rdf_source_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
require 'spec_helper'

describe ActiveTriples::RDFSource do
let(:dummy_source) { Class.new { include ActiveTriples::RDFSource } }

let(:source_class) { Class.new { include ActiveTriples::RDFSource } }
let(:uri) { RDF::URI('http://example.org/moomin') }

subject { source_class.new }

describe '#==' do

shared_examples 'Term equality' do
it 'equals itself' do
expect(subject).to eq subject
end

it 'equals its clone' do
expect(subject).to eq source_class.new(subject.rdf_subject)
end

it 'does not equal another term' do
expect(subject).not_to eq RDF::Node.new
end

it 'does not equal another term' do
expect(subject).not_to eq source_class.new
end
end

include_examples 'Term equality'

context 'with a URI' do
include_examples 'Term equality' do
subject { source_class.new(uri) }
end
end
end

describe ".apply_schema" do
let(:dummy_source) { Class.new { include ActiveTriples::RDFSource } }

before do
class MyDataModel < ActiveTriples::Schema
property :test_title, :predicate => RDF::DC.title
Expand Down

0 comments on commit 896e890

Please sign in to comment.