forked from resque/resque
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for the hoptoad failure backend
This class did not have a test previously, it's about time it got one.
- Loading branch information
1 parent
295f5ab
commit c41c9ca
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ gemspec | |
|
||
group :test do | ||
gem "rack-test", "~> 0.5" | ||
gem "mocha", "~> 0.9.7" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'test_helper' | ||
require 'resque/failure/hoptoad' | ||
require 'mocha' | ||
require 'hoptoad_notifier' | ||
|
||
context "Hoptoad" do | ||
|
||
test "should be notified of an error" do | ||
exception = StandardError.new("BOOM") | ||
worker = Resque::Worker.new(:test) | ||
queue = "test" | ||
payload = {'class' => Object, 'args' => 66} | ||
|
||
HoptoadNotifier.expects(:notify_or_ignore).with( | ||
exception, | ||
:parameters => {:payload_class => 'Object', :payload_args => '66'}) | ||
|
||
backend = Resque::Failure::Hoptoad.new(exception, worker, queue, payload) | ||
backend.save | ||
|
||
end | ||
|
||
end |