mirror of
https://github.com/endofunky/sidetiq.git
synced 2022-11-09 13:53:30 -05:00
25 lines
479 B
Ruby
25 lines
479 B
Ruby
![]() |
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
|
||
|
|
||
|
|