spec/lib/hybag/baggable_spec.rb in hybag-0.0.3 vs spec/lib/hybag/baggable_spec.rb in hybag-0.0.4
- old
+ new
@@ -7,10 +7,12 @@
before(:each) do
@item = BaggableDummy.new(:pid => "filler")
@item.descMetadata.content = File.open(File.join(FIXTURE_PATH,"example_datastream.nt")).read
content_file = File.open(File.join(FIXTURE_PATH,"hydra.png"))
@item.add_file_datastream(content_file, :dsid => "content", :mimeType => "image/png")
+ @item.rels_ext.content = File.open(File.join(FIXTURE_PATH,"rels.rdf")).read
+ @item.load_relationships
@item.stub(:persisted?).and_return(true)
# Stub Rails root
rails = double("Rails")
Rails = rails unless defined?(Rails)
Rails.stub(:root).and_return(Pathname.new('/test'))
@@ -43,11 +45,10 @@
let(:bag) {@bag}
before(:each) do
@bag = @item.write_bag('/tmp/bag')
end
it "should write tag files to disk" do
- # TODO: stub out a rels-ext to make sure this happens.
- #@bag.tag_files.should include(File.join(@bag.bag_dir, 'fedora', 'RELS-EXT.rdf'))
+ @bag.tag_files.should include(File.join(@bag.bag_dir, 'fedora', 'RELS-EXT.rdf'))
@bag.tag_files.should include(File.join(@bag.bag_dir, 'descMetadata.nt'))
end
it "should write content files to disk" do
@bag.bag_files[0].should include('content.png')
end
\ No newline at end of file