Skip to content

Commit d2b7766

Browse files
committed
Test new client-setname functionality
1 parent 2ba7b2e commit d2b7766

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/connection_handling_test.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ def test_auth
1717
end
1818
end
1919

20+
def test_id
21+
commands = {
22+
:client => lambda { |cmd, name| $name = [cmd, name]; "+OK" },
23+
:ping => lambda { "+PONG" },
24+
}
25+
26+
redis_mock(commands, :id => "client-name") do |redis|
27+
assert_equal "PONG", redis.ping
28+
end
29+
30+
assert_equal ["setname","client-name"], $name
31+
end
32+
2033
def test_ping
2134
assert_equal "PONG", r.ping
2235
end

0 commit comments

Comments
 (0)