File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
test/redis_client/cluster Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,15 @@ class RedisClient
7
7
class Cluster
8
8
class TestCommand < TestingWrapper
9
9
def setup
10
- @raw_clients = TEST_NODE_URIS . map { |addr | ::RedisClient . config ( url : addr , **TEST_GENERIC_OPTIONS ) . new_client }
10
+ per_node_key = TEST_REDIS_PORTS . map do |port |
11
+ [
12
+ "#{ TEST_REDIS_HOST } :#{ port } " ,
13
+ { host : TEST_REDIS_HOST , port : port } . merge ( TEST_GENERIC_OPTIONS )
14
+ ]
15
+ end . to_h
16
+ node_info_list = ::RedisClient ::Cluster ::Node . load_info ( per_node_key )
17
+ @raw_clients = ::RedisClient ::Cluster ::Node . new ( per_node_key , node_info_list : node_info_list )
18
+ @empty_clients = ::RedisClient ::Cluster ::Node . new ( [ ] , node_info_list : node_info_list )
11
19
end
12
20
13
21
def teardown
@@ -17,7 +25,7 @@ def teardown
17
25
def test_load
18
26
[
19
27
{ nodes : @raw_clients , error : nil } ,
20
- { nodes : [ ] , error : ::RedisClient ::Cluster ::InitialSetupError } ,
28
+ { nodes : @empty_clients , error : ::RedisClient ::Cluster ::InitialSetupError } ,
21
29
{ nodes : [ '' ] , error : NoMethodError } ,
22
30
{ nodes : nil , error : ::RedisClient ::Cluster ::InitialSetupError }
23
31
] . each_with_index do |c , idx |
You can’t perform that action at this time.
0 commit comments