@@ -88,43 +88,47 @@ def test_psubscribe_and_punsubscribe
88
88
end
89
89
90
90
def test_pubsub_with_numpat_subcommand
91
- @subscribed = false
92
- wire = Wire . new do
93
- r . psubscribe ( "f*" ) do |on |
94
- on . psubscribe { |channel , total | @subscribed = true }
95
- on . pmessage { |pattern , channel , message | r . punsubscribe }
91
+ target_version ( "2.8.0" ) do
92
+ @subscribed = false
93
+ wire = Wire . new do
94
+ r . psubscribe ( "f*" ) do |on |
95
+ on . psubscribe { |channel , total | @subscribed = true }
96
+ on . pmessage { |pattern , channel , message | r . punsubscribe }
97
+ end
96
98
end
97
- end
98
- Wire . pass while !@subscribed
99
- redis = Redis . new ( OPTIONS )
100
- numpat_result = redis . pubsub ( :numpat )
99
+ Wire . pass while !@subscribed
100
+ redis = Redis . new ( OPTIONS )
101
+ numpat_result = redis . pubsub ( :numpat )
101
102
102
- redis . publish ( "foo" , "s1" )
103
- wire . join
103
+ redis . publish ( "foo" , "s1" )
104
+ wire . join
104
105
105
- assert_equal redis . pubsub ( :numpat ) , 0
106
- assert_equal numpat_result , 1
106
+ assert_equal redis . pubsub ( :numpat ) , 0
107
+ assert_equal numpat_result , 1
108
+ end
107
109
end
108
110
109
111
110
112
def test_pubsub_with_channels_and_numsub_subcommnads
111
- @subscribed = false
112
- wire = Wire . new do
113
- r . subscribe ( "foo" ) do |on |
114
- on . subscribe { |channel , total | @subscribed = true }
115
- on . message { |channel , message | r . unsubscribe }
113
+ target_version ( "2.8.0" ) do
114
+ @subscribed = false
115
+ wire = Wire . new do
116
+ r . subscribe ( "foo" ) do |on |
117
+ on . subscribe { |channel , total | @subscribed = true }
118
+ on . message { |channel , message | r . unsubscribe }
119
+ end
116
120
end
117
- end
118
- Wire . pass while !@subscribed
119
- redis = Redis . new ( OPTIONS )
120
- channels_result = redis . pubsub ( :channels )
121
- numsub_result = redis . pubsub ( :numsub , 'foo' , 'boo' )
121
+ Wire . pass while !@subscribed
122
+ redis = Redis . new ( OPTIONS )
123
+ channels_result = redis . pubsub ( :channels )
124
+ numsub_result = redis . pubsub ( :numsub , 'foo' , 'boo' )
122
125
123
- redis . publish ( "foo" , "s1" )
124
- wire . join
126
+ redis . publish ( "foo" , "s1" )
127
+ wire . join
125
128
126
- assert_equal channels_result , [ 'foo' ]
127
- assert_equal numsub_result , [ 'foo' , '1' , 'boo' , '0' ]
129
+ assert_equal channels_result , [ 'foo' ]
130
+ assert_equal numsub_result , [ 'foo' , '1' , 'boo' , '0' ]
131
+ end
128
132
end
129
133
130
134
def test_subscribe_connection_usable_after_raise
0 commit comments