Skip to content
Browse files

test that Queues can be dynamically added/removed

without restarting a worker when using '*'
  • Loading branch information...
1 parent 6951307 commit aa6ac0aba8c19bc708bf7b568a25efb7ec9e9c49 @hone hone committed
Showing with 18 additions and 0 deletions.
  1. +18 −0 test/worker_test.rb
View
18 test/worker_test.rb
@@ -163,6 +163,24 @@ def self.exception
assert_equal %w( jobs high critical blahblah ).sort, processed_queues
end
+ it "can work with dynamically added queues when using wildcard" do
+ worker = Resque::Worker.new("*")
+
+ assert_equal ["jobs"], Resque.queues
+
+ Resque::Job.create(:high, GoodJob)
+ Resque::Job.create(:critical, GoodJob)
+ Resque::Job.create(:blahblah, GoodJob)
+
+ processed_queues = []
+
+ worker.work(0) do |job|
+ processed_queues << job.queue
+ end
+
+ assert_equal %w( jobs high critical blahblah ).sort, processed_queues
+ end
+
it "has a unique id" do
assert_equal "#{`hostname`.chomp}:#{$$}:jobs", @worker.to_s
end

0 comments on commit aa6ac0a

Please sign in to comment.
Something went wrong with that request. Please try again.