spec/riak/bucket_spec.rb in riak-client-0.9.0.beta vs spec/riak/bucket_spec.rb in riak-client-0.9.0.beta2
- old
+ new
@@ -118,19 +118,19 @@
@backend.should_receive(:fetch_object).with(@bucket,"db", nil).and_return(@object)
@bucket.get_or_new('db').should == @object
end
it "should create a new blank object if the key does not exist" do
- @backend.should_receive(:fetch_object).and_raise(Riak::FailedRequest.new(:get, 200, 404, {}, "File not found"))
+ @backend.should_receive(:fetch_object).and_raise(Riak::HTTPFailedRequest.new(:get, 200, 404, {}, "File not found"))
obj = @bucket.get_or_new('db')
obj.key.should == 'db'
obj.data.should be_blank
end
it "should bubble up non-ok non-missing errors" do
- @backend.should_receive(:fetch_object).and_raise(Riak::FailedRequest.new(:get, 200, 500, {}, "File not found"))
- lambda { @bucket.get_or_new('db') }.should raise_error(Riak::FailedRequest)
+ @backend.should_receive(:fetch_object).and_raise(Riak::HTTPFailedRequest.new(:get, 200, 500, {}, "File not found"))
+ lambda { @bucket.get_or_new('db') }.should raise_error(Riak::HTTPFailedRequest)
end
it "should pass along the given R quorum parameter" do
@object = mock("RObject")
@backend.should_receive(:fetch_object).with(@bucket,"db", "all").and_return(@object)
@@ -190,10 +190,10 @@
@backend.should_receive(:fetch_object).and_return(mock)
@bucket.exists?("foo").should be_true
end
it "should return false if the object doesn't exist" do
- @backend.should_receive(:fetch_object).and_raise(Riak::FailedRequest.new(:get, [200,300], 404, {}, "not found"))
+ @backend.should_receive(:fetch_object).and_raise(Riak::HTTPFailedRequest.new(:get, [200,300], 404, {}, "not found"))
@bucket.exists?("foo").should be_false
end
end
describe "deleting an object" do