mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Fix leaky global state
This commit is contained in:
parent
513334445c
commit
846e661de4
1 changed files with 9 additions and 5 deletions
|
@ -70,11 +70,15 @@ class TestSidekiq < Sidekiq::Test
|
|||
describe 'error handling' do
|
||||
it 'deals with user-specified error handlers which raise errors' do
|
||||
output = capture_logging do
|
||||
Sidekiq.error_handlers << proc {|x, hash|
|
||||
raise 'boom'
|
||||
}
|
||||
cli = Sidekiq::CLI.new
|
||||
cli.handle_exception(RuntimeError.new("hello"))
|
||||
begin
|
||||
Sidekiq.error_handlers << proc {|x, hash|
|
||||
raise 'boom'
|
||||
}
|
||||
cli = Sidekiq::CLI.new
|
||||
cli.handle_exception(RuntimeError.new("hello"))
|
||||
ensure
|
||||
Sidekiq.error_handlers.pop
|
||||
end
|
||||
end
|
||||
assert_includes output, "boom"
|
||||
assert_includes output, "ERROR"
|
||||
|
|
Loading…
Add table
Reference in a new issue