This repository has been archived by the owner on Mar 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include Chatterbox version at the bottom of exception notifications
- Loading branch information
Showing
6 changed files
with
42 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Feature: Exception Notification | ||
|
||
As a Chatterbox user | ||
I want to use Chatterbox for exception notifications | ||
So that I can deliver notifications over email | ||
|
||
Scenario: Exceptions include the Chatterbox version string | ||
Given a file named "exceptions.rb" with: | ||
""" | ||
require "chatterbox" | ||
require "chatterbox/exception_notification" | ||
require "chatterbox/services/email" | ||
ActionMailer::Base.delivery_method = :test | ||
Chatterbox::Publishers.register do |notice| | ||
Chatterbox::Services::Email.deliver(notice) | ||
end | ||
begin | ||
1 / 0 | ||
rescue => exception | ||
Chatterbox::ExceptionNotification.handle(:exception => exception, | ||
:config => { :to => "to@example.com", :from => "from@example.com" }) | ||
end | ||
puts ActionMailer::Base.deliveries.last.encoded | ||
""" | ||
When I run "exceptions.rb" | ||
Then the exit code should be 0 | ||
And the stdout should contain the Chatterbox version string message | ||
|
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,4 @@ | ||
Then /^the stdout should contain the Chatterbox version string message$/ do | ||
version = Chatterbox::Version::STRING | ||
Then %{the stdout should match "Chatterbox Version #{version}"} | ||
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 |
---|---|---|
|
@@ -74,4 +74,5 @@ def clear! | |
end | ||
end | ||
|
||
require "chatterbox/services" | ||
require "chatterbox/services" | ||
require "chatterbox/version" |
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