Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
silentshade committed Mar 5, 2015
1 parent e3acab4 commit 6b2b3f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/workers/simple_worker_test.rb
Expand Up @@ -9,6 +9,12 @@
end

describe "for prepare method" do
it "should make tube names array always unique to avoid duplication" do
worker = @worker_class.new(["foo", "demo.test.foo"])
worker.prepare
assert_equal ["demo.test.foo"], worker.tube_names
end

it "should watch specified tubes" do
worker = @worker_class.new(["foo", "bar"])
out = capture_stdout { worker.prepare }
Expand Down Expand Up @@ -243,4 +249,4 @@
Backburner.configure { |config| config.max_job_retries = 0; config.retry_delay = 5 }
end
end # work_one_job
end # Worker
end # Worker
6 changes: 6 additions & 0 deletions test/workers/threads_on_fork_worker_test.rb
Expand Up @@ -54,6 +54,12 @@
Backburner.configure { |config| config.logger = false }
end

it "should make tube names array always unique to avoid duplication" do
worker = @worker_class.new(["foo", "demo.test.foo"])
worker.prepare
assert_equal ["demo.test.foo"], worker.tube_names
end

it "should watch specified tubes" do
worker = @worker_class.new(["foo", "bar"])
out = capture_stdout { worker.prepare }
Expand Down

0 comments on commit 6b2b3f4

Please sign in to comment.