@@ -115,6 +115,36 @@ def self.exception
115
115
assert_equal 0 , Resque . size ( :blahblah )
116
116
end
117
117
118
+ test "can work with wildcard at the end of the list" do
119
+ Resque ::Job . create ( :high , GoodJob )
120
+ Resque ::Job . create ( :critical , GoodJob )
121
+ Resque ::Job . create ( :blahblah , GoodJob )
122
+ Resque ::Job . create ( :beer , GoodJob )
123
+
124
+ worker = Resque ::Worker . new ( :critical , :high , "*" )
125
+
126
+ worker . work ( 0 )
127
+ assert_equal 0 , Resque . size ( :high )
128
+ assert_equal 0 , Resque . size ( :critical )
129
+ assert_equal 0 , Resque . size ( :blahblah )
130
+ assert_equal 0 , Resque . size ( :beer )
131
+ end
132
+
133
+ test "can work with wildcard at the middle of the list" do
134
+ Resque ::Job . create ( :high , GoodJob )
135
+ Resque ::Job . create ( :critical , GoodJob )
136
+ Resque ::Job . create ( :blahblah , GoodJob )
137
+ Resque ::Job . create ( :beer , GoodJob )
138
+
139
+ worker = Resque ::Worker . new ( :critical , "*" , :high )
140
+
141
+ worker . work ( 0 )
142
+ assert_equal 0 , Resque . size ( :high )
143
+ assert_equal 0 , Resque . size ( :critical )
144
+ assert_equal 0 , Resque . size ( :blahblah )
145
+ assert_equal 0 , Resque . size ( :beer )
146
+ end
147
+
118
148
test "processes * queues in alphabetical order" do
119
149
Resque ::Job . create ( :high , GoodJob )
120
150
Resque ::Job . create ( :critical , GoodJob )
0 commit comments