1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Merge branch 'master' of github.com:mperham/sidekiq

This commit is contained in:
Mike Perham 2013-07-16 21:20:47 -07:00
commit c555ef9c93
2 changed files with 4 additions and 8 deletions

View file

@ -33,7 +33,7 @@ module Sidekiq
end
def send_to_exception_notifier(msg, ex)
::ExceptionNotifier::Notifier.background_exception_notification(ex, :data => { :message => msg }).deliver
::ExceptionNotifier.notify_exception(ex, :data => {:message => msg})
end
end
end

View file

@ -73,8 +73,7 @@ class TestExceptionHandler < Minitest::Test
describe "with fake ExceptionNotifier" do
before do
::ExceptionNotifier = Module.new
::ExceptionNotifier::Notifier = MiniTest::Mock.new
::ExceptionNotifier = MiniTest::Mock.new
end
after do
@ -82,12 +81,9 @@ class TestExceptionHandler < Minitest::Test
end
it "notifies ExceptionNotifier" do
mail = MiniTest::Mock.new
mail.expect(:deliver,nil)
::ExceptionNotifier::Notifier.expect(:background_exception_notification,mail,[TEST_EXCEPTION, :data => { :message => { :b => 2 } }])
::ExceptionNotifier.expect(:notify_exception,true,[TEST_EXCEPTION, :data => { :message => { :b => 2 } }])
Component.new.invoke_exception(:b => 2)
::ExceptionNotifier::Notifier.verify
mail.verify
::ExceptionNotifier.verify
end
end