Permalink
Browse files

Aliased get_multiple to read_multiple.

  • Loading branch information...
1 parent 57f8460 commit 6db732b8dad728d8ad8b6fe17b5d8a3149777172 @jnunemaker committed Nov 7, 2012
Showing with 27 additions and 0 deletions.
  1. +2 −0 lib/adapter.rb
  2. +25 −0 lib/adapter/spec/an_adapter.rb
View
@@ -49,6 +49,8 @@ def initialize(client, options={})
alias [] read
alias []= write
+ alias_method :get_multiple, :read_multiple
+
def eql?(other)
self.class.eql?(other.class) && client == other.client
end
@@ -78,6 +78,31 @@
end
end
+ describe "#get_multiple" do
+ before do
+ adapter.write(key, attributes)
+ adapter.write(key2, attributes2)
+ end
+
+ it "returns Hash of keys and values" do
+ adapter.get_multiple(key, key2).should eq({
+ key => attributes,
+ key2 => attributes2,
+ })
+ end
+
+ context "with mix of keys that are and are not available" do
+ it "returns Hash of keys and values where unavailable keys are nil" do
+ adapter.get_multiple(key, key2, 'foo', 'bar').should eq({
+ key => attributes,
+ key2 => attributes2,
+ 'foo' => nil,
+ 'bar' => nil,
+ })
+ end
+ end
+ end
+
describe "#key?" do
it "returns true if key available" do
adapter.write(key, attributes)

0 comments on commit 6db732b

Please sign in to comment.