Sha256: a31d544216ce08e72bc6d33ff82b717d33f8f60f70d398587b05da3b4949e839

Contents?: true

Size: 779 Bytes

Versions: 1

Compression:

Stored size: 779 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

  subject(:attached_files) { f.attached_files }
  let(:f) { Foo.new }

  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

1 entries across 1 versions & 1 rubygems

Version Path
active-fedora-11.1.5 spec/unit/inheritance_spec.rb