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

Fixed ExceptionNotifier test

This commit is contained in:
Dimko 2013-05-07 20:17:32 +04:00
parent d2af4ef525
commit 7bd41fd7ef

View file

@ -73,8 +73,7 @@ class TestExceptionHandler < MiniTest::Unit::TestCase
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::Unit::TestCase
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,nil,[TEST_EXCEPTION, :data => { :message => { :b => 2 } }])
Component.new.invoke_exception(:b => 2)
::ExceptionNotifier::Notifier.verify
mail.verify
::ExceptionNotifier.verify
end
end