Skip to content

Commit

Permalink
Add support for HMSET.
Browse files Browse the repository at this point in the history
  • Loading branch information
djanowski committed Apr 15, 2010
1 parent 9e43fde commit 80ca095
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/redis/client.rb
Expand Up @@ -41,7 +41,8 @@ def initialize(reply_type)
MULTI_BULK_COMMANDS = {
"mset" => true,
"msetnx" => true,
"hset" => true
"hset" => true,
"hmset" => true
}

BOOLEAN_PROCESSOR = lambda{|r| r == 1 }
Expand Down
7 changes: 7 additions & 0 deletions test/redis_test.rb
Expand Up @@ -766,6 +766,13 @@ def redis.call_command(attrs)

assert_equal({"f1" => "s1", "f2" => "s2"}, @r.hgetall("foo"))
end

test "HMSET" do
@r.hmset("hash", "foo1", "bar1", "foo2", "bar2")

assert_equal "bar1", @r.hget("hash", "foo1")
assert_equal "bar2", @r.hget("hash", "foo2")
end
end

context "Sorting" do
Expand Down

0 comments on commit 80ca095

Please sign in to comment.