Permalink
Browse files

Merge branch 'bugfix-array-arguments-for-zadd'

  • Loading branch information...
2 parents b6e7a61 + 8b74e90 commit c3b7d4f2c03c3bce0c3b56ee750ddb316136b263 @caius caius committed Mar 7, 2013
Showing with 5 additions and 1 deletion.
  1. +1 −1 lib/redis/connection/memory.rb
  2. +4 −0 spec/sorted_sets_spec.rb
@@ -726,7 +726,7 @@ def zadd(key, *args)
data_type_check(key, ZSet)
data[key] ||= ZSet.new
- if args.size == 2
+ if args.size == 2 && !(Array === args.first)
score, value = args
exists = !data[key].key?(value.to_s)
data[key][value.to_s] = score
View
@@ -44,6 +44,10 @@ module FakeRedis
@client.zscore("key", "val2").should be == 2
@client.zscore("key", "val3").should be == 3
@client.zscore("key", "val4").should be == 4
+
+ @client.zadd("key", [[5, "val5"], [3, "val6"]]).should be == 2
+ @client.zscore("key", "val5").should be == 5
+ @client.zscore("key", "val6").should be == 3
end
it "should error with wrong number of arguments when adding members" do

0 comments on commit c3b7d4f

Please sign in to comment.