test/lib/testing/inline_test.rb in sidekiq-lock-0.3.1 vs test/lib/testing/inline_test.rb in sidekiq-lock-0.4.0

- old
+ new

@@ -1,21 +1,24 @@ require "test_helper" require "sidekiq/lock/testing/inline" describe "inline test helper" do - after { set_lock_variable! } + after { reset_lock_variable! } it "has helper fuction for setting lock" do - Sidekiq::Lock::RedisLock.expects(:new).with({ timeout: 1, name: 'lock-worker' }, 'worker argument').returns('lock set') + Sidekiq::Lock::RedisLock + .expects(:new) + .with({ timeout: 1, name: 'lock-worker' }, 'worker argument') + .returns('lock set') + set_sidekiq_lock(LockWorker, 'worker argument') - assert_equal 'lock set', lock_thread_variable + assert_equal 'lock set', lock_container_variable end it "has helper fuction for clearing lock" do set_lock_variable! "test" - assert_equal "test", lock_thread_variable + assert_equal "test", lock_container_variable clear_sidekiq_lock - assert_nil lock_thread_variable + assert_nil lock_container_variable end - end