Commits

Sean Cribbs  committed 93b8831

Don't load the keys by default when requesting a bucket. Closes #36.

  • Participants
  • Parent commits 61c6def

Comments (0)

Files changed (2)

File riak-client/lib/riak/client.rb

     # @return [Bucket] the requested bucket
     def bucket(name, options={})
       options.assert_valid_keys(:keys, :props)
-      response = http.get(200, prefix, escape(name), options, {})
+      response = http.get(200, prefix, escape(name), {:keys => false}.merge(options), {})
       Bucket.new(self, name).load(response)
     end
     alias :[] :bucket

File riak-client/spec/riak/client_spec.rb

-# Copyright 2010 Sean Cribbs, Sonian Inc., and Basho Technologies, Inc.
+60# Copyright 2010 Sean Cribbs, Sonian Inc., and Basho Technologies, Inc.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License");
 #    you may not use this file except in compliance with the License.
     end
 
     it "should send a GET request to the bucket name and return a Riak::Bucket" do
-      @http.should_receive(:get).with(200, "/riak/", "foo", {}, {}).and_return(@payload)
+      @http.should_receive(:get).with(200, "/riak/", "foo", {:keys => false}, {}).and_return(@payload)
       @client.bucket("foo").should be_kind_of(Riak::Bucket)
     end
 
-    it "should allow requesting bucket properties without the keys" do
-      @http.should_receive(:get).with(200, "/riak/", "foo", {:keys => false}, {}).and_return(@payload)
-      @client.bucket("foo", :keys => false)
+    it "should allow requesting bucket properties with the keys" do
+      @http.should_receive(:get).with(200, "/riak/", "foo", {:keys => true}, {}).and_return(@payload)
+      @client.bucket("foo", :keys => true)
     end
 
     it "should escape bucket names with invalid characters" do