File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -187,22 +187,24 @@ def test_config_set
187
187
end
188
188
end
189
189
190
- def test_consistency_on_multithreaded_env
191
- t = nil
190
+ driver ( :ruby , :hiredis ) do
191
+ def test_consistency_on_multithreaded_env
192
+ t = nil
193
+
194
+ commands = {
195
+ :set => lambda { |key , value | t . kill ; "+OK\r \n " } ,
196
+ :incr => lambda { |key | ":1\r \n " } ,
197
+ }
198
+
199
+ redis_mock ( commands ) do |redis |
200
+ t = Thread . new do
201
+ redis . set ( "foo" , "bar" )
202
+ end
192
203
193
- commands = {
194
- :set => lambda { |key , value | t . kill ; "+OK\r \n " } ,
195
- :incr => lambda { |key | ":1\r \n " } ,
196
- }
204
+ t . join
197
205
198
- redis_mock ( commands ) do |redis |
199
- t = Thread . new do
200
- redis . set ( "foo" , "bar" )
206
+ assert_equal 1 , redis . incr ( "baz" )
201
207
end
202
-
203
- t . join
204
-
205
- assert_equal 1 , redis . incr ( "baz" )
206
208
end
207
209
end
208
210
end
You can’t perform that action at this time.
0 commit comments