Skip to content

Commit 64405f3

Browse files
committed
More usable assertions.
1 parent c9350a2 commit 64405f3

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

test/scanning_test.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_scan_each_enumerator
6565
keys_from_scan = scan_enumerator.to_a.uniq
6666
all_keys = r.keys "*"
6767

68-
assert_equal all_keys.sort, keys_from_scan.sort
68+
assert all_keys.sort == keys_from_scan.sort
6969
end
7070
end
7171

@@ -77,7 +77,7 @@ def test_scan_each_enumerator_match
7777
keys_from_scan = r.scan_each(:match => "key:1??").to_a.uniq
7878
all_keys = r.keys "key:1??"
7979

80-
assert_equal all_keys.sort, keys_from_scan.sort
80+
assert all_keys.sort == keys_from_scan.sort
8181
end
8282
end
8383

@@ -93,7 +93,7 @@ def test_scan_each_block
9393

9494
all_keys = r.keys "*"
9595

96-
assert_equal all_keys.sort, keys_from_scan.uniq.sort
96+
assert all_keys.sort == keys_from_scan.uniq.sort
9797
end
9898
end
9999

@@ -109,7 +109,7 @@ def test_scan_each_block_match
109109

110110
all_keys = r.keys "key:1?"
111111

112-
assert_equal all_keys.sort, keys_from_scan.uniq.sort
112+
assert all_keys.sort == keys_from_scan.uniq.sort
113113
end
114114
end
115115

@@ -153,7 +153,7 @@ def test_sscan_each_enumerator
153153
keys_from_scan = scan_enumerator.to_a.uniq
154154
all_keys = r.smembers("set")
155155

156-
assert_equal all_keys.sort, keys_from_scan.sort
156+
assert all_keys.sort == keys_from_scan.sort
157157
end
158158
end
159159

@@ -167,7 +167,7 @@ def test_sscan_each_enumerator_match
167167

168168
all_keys = r.smembers("set").grep(/^ele:1.$/)
169169

170-
assert_equal all_keys.sort, keys_from_scan.sort
170+
assert all_keys.sort == keys_from_scan.sort
171171
end
172172
end
173173

@@ -184,7 +184,7 @@ def test_sscan_each_enumerator_block
184184

185185
all_keys = r.smembers("set")
186186

187-
assert_equal all_keys.sort, keys_from_scan.uniq.sort
187+
assert all_keys.sort == keys_from_scan.uniq.sort
188188
end
189189
end
190190

@@ -201,7 +201,7 @@ def test_sscan_each_enumerator_block_match
201201

202202
all_keys = r.smembers("set").grep(/^ele:1.$/)
203203

204-
assert_equal all_keys.sort, keys_from_scan.uniq.sort
204+
assert all_keys.sort == keys_from_scan.uniq.sort
205205
end
206206
end
207207

@@ -252,7 +252,7 @@ def test_hscan_each_enumerator
252252
keys_from_scan = scan_enumerator.to_a.uniq
253253
all_keys = r.hgetall("hash").to_a
254254

255-
assert_equal all_keys.sort, keys_from_scan.sort
255+
assert all_keys.sort == keys_from_scan.sort
256256
end
257257
end
258258

@@ -269,7 +269,7 @@ def test_hscan_each_enumerator_match
269269
keys_from_scan = r.hscan_each("hash", :match => "key:1?").to_a.uniq
270270
all_keys = r.hgetall("hash").to_a.select{|k,v| k =~ /^key:1.$/}
271271

272-
assert_equal all_keys.sort, keys_from_scan.sort
272+
assert all_keys.sort == keys_from_scan.sort
273273
end
274274
end
275275

@@ -286,7 +286,7 @@ def test_hscan_each_block
286286
end
287287
all_keys = r.hgetall("hash").to_a
288288

289-
assert_equal all_keys.sort, keys_from_scan.uniq.sort
289+
assert all_keys.sort == keys_from_scan.uniq.sort
290290
end
291291
end
292292

@@ -306,7 +306,7 @@ def test_hscan_each_block_match
306306
end
307307
all_keys = r.hgetall("hash").to_a.select{|k,v| k =~ /^key:1.$/}
308308

309-
assert_equal all_keys.sort, keys_from_scan.uniq.sort
309+
assert all_keys.sort == keys_from_scan.uniq.sort
310310
end
311311
end
312312

@@ -358,7 +358,7 @@ def test_zscan_each_enumerator
358358
scores_from_scan = scan_enumerator.to_a.uniq
359359
member_scores = r.zrange("zset", 0, -1, :with_scores => true)
360360

361-
assert_equal member_scores.sort, scores_from_scan.sort
361+
assert member_scores.sort == scores_from_scan.sort
362362
end
363363
end
364364

@@ -376,7 +376,7 @@ def test_zscan_each_enumerator_match
376376
member_scores = r.zrange("zset", 0, -1, :with_scores => true)
377377
filtered_members = member_scores.select{|k,s| k =~ /^key:1..$/}
378378

379-
assert_equal filtered_members.sort, scores_from_scan.sort
379+
assert filtered_members.sort == scores_from_scan.sort
380380
end
381381
end
382382

@@ -393,7 +393,7 @@ def test_zscan_each_block
393393
end
394394
member_scores = r.zrange("zset", 0, -1, :with_scores => true)
395395

396-
assert_equal member_scores.sort, scores_from_scan.sort
396+
assert member_scores.sort == scores_from_scan.sort
397397
end
398398
end
399399

@@ -414,7 +414,7 @@ def test_zscan_each_block_match
414414
member_scores = r.zrange("zset", 0, -1, :with_scores => true)
415415
filtered_members = member_scores.select{|k,s| k =~ /^key:1..$/}
416416

417-
assert_equal filtered_members.sort, scores_from_scan.sort
417+
assert filtered_members.sort == scores_from_scan.sort
418418
end
419419
end
420420

0 commit comments

Comments
 (0)