spec/support/mock_fedora.rb in active-fedora-3.2.0.pre3 vs spec/support/mock_fedora.rb in active-fedora-3.2.0.pre4

- old
+ new

@@ -15,12 +15,12 @@ datastreams ||= ['someData', 'withText', 'withText2', 'RELS-EXT'] datastreams.each do |dsid| mock_client.stubs(:[]).with("objects/#{pid}/datastreams/#{dsid}?format=xml").returns(@getter) end end -def stub_ingest(pid) - n = pid.gsub(/:/, '%3A') - mock_client.stubs(:[]).with("objects/#{n || 'new'}").returns(stub("ingester", :post=>pid)) +def stub_ingest(pid=nil) + n = pid ? pid.gsub(/:/, '%3A') : nil + mock_client.expects(:[]).with("objects/#{n || 'new'}").returns(stub("ingester", :post=>pid)) end def stub_add_ds(pid, dsids) pid.gsub!(/:/, '%3A') dsids.each do |dsid|