Skip to content

Commit 7aa417a

Browse files
committed
Check for either ziplist or quicklist
Recent Redis introduced a new encoding, which we need to test for. Also: changed order of arguments to assertions. Expected comes first. This leads to better error messages in case an assertion fails.
1 parent fe39c55 commit 7aa417a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/remote_server_control_commands_test.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def test_monitor_returns_value_for_break
8282
break line
8383
end
8484

85-
assert_equal result, "OK"
85+
assert_equal "OK", result
8686
end
8787

8888
def test_echo
@@ -98,8 +98,9 @@ def test_debug
9898
def test_object
9999
r.lpush "list", "value"
100100

101-
assert_equal r.object(:refcount, "list"), 1
102-
assert_equal r.object(:encoding, "list"), "ziplist"
101+
assert_equal 1, r.object(:refcount, "list")
102+
encoding = r.object(:encoding, "list")
103+
assert "ziplist" == encoding || "quicklist" == encoding, "Wrong encoding for list"
103104
assert r.object(:idletime, "list").kind_of?(Fixnum)
104105
end
105106

@@ -112,6 +113,6 @@ def test_sync
112113
def test_slowlog
113114
r.slowlog(:reset)
114115
result = r.slowlog(:len)
115-
assert_equal result, 0
116+
assert_equal 0, result
116117
end
117118
end

0 commit comments

Comments
 (0)