1
0
Fork 0
mirror of https://github.com/endofunky/sidetiq.git synced 2022-11-09 13:53:30 -05:00
endofunky--sidetiq/test/test_watcher.rb

25 lines
479 B
Ruby
Raw Normal View History

2013-09-17 11:55:06 +01:00
require_relative 'helper'
class TestWatcher < Sidetiq::TestCase
def setup
Sidetiq.config.lock.watcher.remove_lock = true
Sidetiq.config.lock.watcher.notify = true
@worker = Sidetiq::Lock::Watcher.new
end
def test_perform
Sidetiq::Lock::Redis.new("foobar", 1000000).lock
assert_equal 1, Sidetiq::Lock::Redis.all.length
@worker.expects(:handle_exception).once
@worker.perform
assert_equal 0, Sidetiq::Lock::Redis.all.length
end
end