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
77 class Cluster
88 class TestCommand < TestingWrapper
99 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 )
1119 end
1220
1321 def teardown
@@ -17,7 +25,7 @@ def teardown
1725 def test_load
1826 [
1927 { nodes : @raw_clients , error : nil } ,
20- { nodes : [ ] , error : ::RedisClient ::Cluster ::InitialSetupError } ,
28+ { nodes : @empty_clients , error : ::RedisClient ::Cluster ::InitialSetupError } ,
2129 { nodes : [ '' ] , error : NoMethodError } ,
2230 { nodes : nil , error : ::RedisClient ::Cluster ::InitialSetupError }
2331 ] . each_with_index do |c , idx |
You can’t perform that action at this time.
0 commit comments