Sha256: 4480081d6fee92064f0beef82b7d97bbe2dfee21112b39814d68d62a324c0815
Contents?: true
Size: 1.34 KB
Versions: 30
Compression:
Stored size: 1.34 KB
Contents
require 'spec_helper' require 'active_fedora' require 'active_fedora/base' require 'active_fedora/metadata_datastream' require 'active_fedora/qualified_dublin_core_datastream' describe ActiveFedora::Base do before(:each) do #Fedora::Repository.instance.stubs(:nextid).returns("_nextid_") class Foo < ActiveFedora::Base has_metadata :type=>ActiveFedora::MetadataDatastream, :name=>"foostream" do|m| m.field "foostream", :string end has_metadata :type=>ActiveFedora::QualifiedDublinCoreDatastream, :name=>"dcstream" do|m| m.field "fz", :string end end class Bar < ActiveFedora::Base has_metadata :type=>ActiveFedora::MetadataDatastream, :name=>"barstream" do |m| m.field "barfield", :string end end end it "doesn't overwrite stream specs" do f = Foo.new f.datastreams.size.should == 3 streams = f.datastreams.values.map{|x| x.class.to_s}.sort streams.pop.should == "ActiveFedora::RelsExtDatastream" streams.pop.should == "ActiveFedora::QualifiedDublinCoreDatastream" streams.pop.should == "ActiveFedora::MetadataDatastream" end it "should work for multiple types" do b = Foo.new f = Bar.new b.class.ds_specs.should_not == f.class.ds_specs end after do Object.send(:remove_const, :Bar) Object.send(:remove_const, :Foo) end end
Version data entries
30 entries across 30 versions & 1 rubygems