Sha256: c825cde4010197a4c0f5a9a400e68a04cddd3f790f2a96696cdc896cc8c2cbf9

Contents?: true

Size: 802 Bytes

Versions: 1

Compression:

Stored size: 802 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::RdfNode do
  describe 'inheritance' do
    before do
      class Parent
        include ActiveFedora::RdfObject
        map_predicates do |map|
          map.title(in: RDF::DC)
        end
      end

      class Child < Parent
        map_predicates do |map|
          map.description(in: RDF::DC)
        end
      end

    end
    after do
      Object.send(:remove_const, :Child)
      Object.send(:remove_const, :Parent)
    end

    describe 'child class' do
      it 'should inherit the terms' do
        expect(Child.config.keys).to eq(['title', 'description'])
      end
    end
    describe 'parent class' do
      it 'should not be infected with the child terms' do
        expect(Parent.config.keys).to eq(['title'])
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active-fedora-6.8.0 spec/unit/rdf_node_spec.rb