Sha256: fe5afb2a50eb892da0b512e3e9f389cd761a016780117e456f9f5a15a2f97154
Contents?: true
Size: 1.52 KB
Versions: 2
Compression:
Stored size: 1.52 KB
Contents
require File.join( File.dirname(__FILE__), "../spec_helper" ) require 'ruby-fedora' describe Fedora::Datastream do before(:each) do Fedora::Repository.register(ActiveFedora.fedora_config[:url]) @test_datastream = Fedora::Datastream.new end it "should track the controlgroup attr" do td = Fedora::Datastream.new(:controlGroup=>'M') td.control_group.should == 'M' end it "should provide .url" do @test_datastream.should respond_to(:url) @test_datastream.expects(:pid).returns("_foo_") @test_datastream.url.should == 'http://localhost:8080/fedora/objects/_foo_/datastreams/' end describe ".url" do it "should return the Repository base_url with /objects/pid appended" do Fedora::Repository.instance.expects(:base_url).returns("BASE_URL") @test_datastream.expects(:pid).returns("_PID_") @test_datastream.expects(:dsid).returns("_DSID_") @test_datastream.url.should == "BASE_URL/objects/_PID_/datastreams/_DSID_" end end describe ".label" do it "should return the dsLabel attribute" do @test_datastream.label.should == @test_datastream.attributes[:dsLabel] end end describe ".label=" do it "should set the dsLabel attribute" do @test_datastream.label.should_not == "Foo dsLabel" @test_datastream.attributes[:dsLabel].should_not == "Foo dsLabel" @test_datastream.label = "Foo dsLabel" @test_datastream.label.should == "Foo dsLabel" @test_datastream.attributes[:dsLabel].should == "Foo dsLabel" end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
active-fedora-1.1.1 | spec/unit/rf_datastream_spec.rb |
active-fedora-1.1.0 | spec/unit/rf_datastream_spec.rb |