|
139 | 139 | worker.queues.should == ["foo"]
|
140 | 140 | end
|
141 | 141 |
|
| 142 | + it "respects the order in which queue patterns are defined" do |
| 143 | + worker = Resque::Worker.new("h*", "f*") |
| 144 | + worker.queues.should == ["high_x", "high_y", "foo"] |
| 145 | + |
| 146 | + worker = Resque::Worker.new("*", "!f*") |
| 147 | + worker.queues.should == ["high_x", "high_y", "superhigh_z"] |
| 148 | + |
| 149 | + worker = Resque::Worker.new("*high*_z", "*", "!f*") |
| 150 | + worker.queues.should == ["superhigh_z", "high_x", "high_y"] |
| 151 | + end |
| 152 | + |
142 | 153 | end
|
143 | 154 |
|
144 | 155 | context "redis backed queues" do
|
145 | 156 |
|
146 | 157 | it "can dynamically lookup queues" do
|
147 | 158 | Resque.set_dynamic_queue("mykey", ["foo", "bar"])
|
148 | 159 | worker = Resque::Worker.new("@mykey")
|
149 |
| - worker.queues.should == ["bar", "foo"] |
| 160 | + worker.queues.should == ["foo", "bar"] |
150 | 161 | end
|
151 | 162 |
|
152 | 163 | it "can blacklist dynamic queues" do
|
|
185 | 196 | host = `hostname`.chomp
|
186 | 197 | Resque.set_dynamic_queue(host, ["foo", "bar"])
|
187 | 198 | worker = Resque::Worker.new("@")
|
188 |
| - worker.queues.should == ["bar", "foo"] |
| 199 | + worker.queues.should == ["foo", "bar"] |
189 | 200 | end
|
190 | 201 |
|
191 | 202 | it "can use wildcards in dynamic queues" do
|
|
202 | 213 | it "falls back to default queues when missing" do
|
203 | 214 | Resque.set_dynamic_queue("default", ["foo", "bar"])
|
204 | 215 | worker = Resque::Worker.new("@mykey")
|
205 |
| - worker.queues.should == ["bar", "foo"] |
| 216 | + worker.queues.should == ["foo", "bar"] |
206 | 217 | end
|
207 | 218 |
|
208 | 219 | it "falls back to all queues when missing and no default" do
|
|
0 commit comments