spec/riak/http_backend_spec.rb in riak-client-1.4.1 vs spec/riak/http_backend_spec.rb in riak-client-1.4.2
- old
+ new
@@ -169,12 +169,23 @@
@backend.list_keys("foo").should == ["bar baz"]
end
end
context "listing buckets" do
- it "should GET the bucket list URL and parse the response as JSON" do
+ before(:each) do
@backend.should_receive(:get).with(200, @backend.bucket_list_path).and_return({:body => '{"buckets":["foo", "bar", "baz"]}'})
- @backend.list_buckets.should == ["foo", "bar", "baz"]
+ end
+
+ context "given no arguments" do
+ it "should GET the bucket list URL and parse the response as JSON" do
+ @backend.list_buckets.should == ["foo", "bar", "baz"]
+ end
+ end
+
+ context "given a hash of options" do
+ it "should GET the bucket list URL and parse the response as JSON" do
+ @backend.list_buckets({}).should == ["foo", "bar", "baz"]
+ end
end
end
context "performing a MapReduce query" do
before do