Sha256: 1916d218f24495c7a933be039a22f6901b6dd43c21e972352021e56237a471af

Contents?: true

Size: 778 Bytes

Versions: 8

Compression:

Stored size: 778 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::Base do
  before do
    class MyDS < ActiveFedora::File
    end

    class MySample < ActiveFedora::File
    end

    class Foo < ActiveFedora::Base
      has_subresource 'foostream', class_name: 'MyDS'
      has_subresource 'dcstream', class_name: 'MySample'
    end

    class Bar < ActiveFedora::Base
      has_subresource 'barstream', class_name: 'MyDS'
    end
  end
  let(:f) { Foo.new }
  subject(:attached_files) { f.attached_files }

  it "doesn't overwrite stream specs" do
    expect(attached_files.values).to match_array [MyDS, MySample]
  end

  after do
    Object.send(:remove_const, :Bar)
    Object.send(:remove_const, :Foo)
    Object.send(:remove_const, :MyDS)
    Object.send(:remove_const, :MySample)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
active-fedora-11.1.4 spec/unit/inheritance_spec.rb
active-fedora-11.1.3 spec/unit/inheritance_spec.rb
active-fedora-11.1.2 spec/unit/inheritance_spec.rb
active-fedora-11.1.1 spec/unit/inheritance_spec.rb
active-fedora-11.1.0 spec/unit/inheritance_spec.rb
active-fedora-11.0.1 spec/unit/inheritance_spec.rb
active-fedora-11.0.0 spec/unit/inheritance_spec.rb
active-fedora-11.0.0.rc7 spec/unit/inheritance_spec.rb