mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
yield instead of block.call
This commit is contained in:
parent
bc265f34ca
commit
de42941e48
1 changed files with 3 additions and 3 deletions
|
@ -7,12 +7,12 @@ module Sidekiq
|
|||
class << self
|
||||
attr_accessor :__test_mode
|
||||
|
||||
def __set_test_mode(mode, &block)
|
||||
if block
|
||||
def __set_test_mode(mode)
|
||||
if block_given?
|
||||
current_mode = self.__test_mode
|
||||
begin
|
||||
self.__test_mode = mode
|
||||
block.call
|
||||
yield
|
||||
ensure
|
||||
self.__test_mode = current_mode
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue