File tree 5 files changed +15
-8
lines changed
5 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -659,7 +659,7 @@ def inspect
659
659
node_info = nodes . map do |node |
660
660
"#{ node . id } (Redis v#{ node . info [ 'redis_version' ] } )"
661
661
end
662
- "<Redis client v#{ Redis ::VERSION } connected to #{ node_info . join ( ', ' ) } >"
662
+ "# <Redis client v#{ Redis ::VERSION } connected to #{ node_info . join ( ', ' ) } >"
663
663
end
664
664
665
665
protected
Original file line number Diff line number Diff line change 13
13
end
14
14
15
15
$TEST_PIPELINING = false
16
- $TEST_INSPECT = false
17
16
18
17
load File . expand_path ( "./lint/internals.rb" , File . dirname ( __FILE__ ) )
18
+
19
+ test "provides a meaningful inspect" do |r , _ |
20
+ nodes = [ "redis://localhost:6379/15" , *NODES ]
21
+ @r = Redis ::Distributed . new nodes
22
+
23
+ node_info = nodes . map do |node |
24
+ "#{ node } (Redis v#{ @r . info . first [ "redis_version" ] } )"
25
+ end
26
+ assert "#<Redis client v#{ Redis ::VERSION } connected to #{ node_info . join ( ', ' ) } >" == @r . inspect
27
+ end
Original file line number Diff line number Diff line change 57
57
r . not_yet_implemented_command
58
58
end
59
59
end
60
-
Original file line number Diff line number Diff line change 12
12
end
13
13
14
14
$TEST_PIPELINING = true
15
- $TEST_INSPECT = true
16
15
17
16
load File . expand_path ( "./lint/internals.rb" , File . dirname ( __FILE__ ) )
18
17
18
+ test "provides a meaningful inspect" do |r , _ |
19
+ assert "#<Redis client v#{ Redis ::VERSION } connected to redis://127.0.0.1:6379/15 (Redis v#{ r . info [ "redis_version" ] } )>" == r . inspect
20
+ end
21
+
19
22
test "Redis.current" do
20
23
Redis . current . set ( "foo" , "bar" )
21
24
Original file line number Diff line number Diff line change 27
27
end
28
28
end
29
29
30
- test "provides a meaningful inspect" do |r , _ |
31
- assert "#<Redis client v#{ Redis ::VERSION } connected to redis://127.0.0.1:6379/15 (Redis v#{ r . info [ "redis_version" ] } )>" == r . inspect
32
- end if $TEST_INSPECT
33
-
34
30
test "raises on protocol errors" do
35
31
redis_mock ( :ping => lambda { |*_ | "foo" } ) do
36
32
assert_raise ( Redis ::ProtocolError ) do
You can’t perform that action at this time.
0 commit comments