forked from kennethkalmer/daemon-kit
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exception mails now handled by TMail
- Loading branch information
1 parent
ddd516f
commit 260a800
Showing
32 changed files
with
7,937 additions
and
34 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
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
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 File.dirname(__FILE__) + '/spec_helper' | ||
|
||
describe DaemonKit::Safety do | ||
end | ||
|
||
describe DaemonKit::ErrorHandlers::Mail do | ||
it "should send an email report" do | ||
conf = Object.new | ||
conf.stubs(:daemon_name).returns('test') | ||
DaemonKit.stubs(:configuration).returns(conf) | ||
|
||
fake_smtp = Object.new | ||
fake_smtp.expects(:start).with('localhost.localdomain', nil, nil, nil) | ||
Net::SMTP.expects(:new).with('localhost', 25).returns(fake_smtp) | ||
|
||
begin | ||
raise RuntimeError, "specs don't fail :)" | ||
rescue => e | ||
handler = DaemonKit::ErrorHandlers::Mail.instance | ||
handler.handle_exception( e ) | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'tmail/version' | ||
require 'tmail/mail' | ||
require 'tmail/mailbox' | ||
require 'tmail/core_extensions' | ||
require 'tmail/net' |
Oops, something went wrong.