Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added integration/readme coverage of Sinatra apps
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,33 @@ | |||
Feature: Use the notifier in a Sinatra app | |||
|
|||
Background: | |||
Given I have built and installed the "hoptoad_notifier" gem | |||
|
|||
Scenario: Rescue an exception in a Sinatra app | |||
Given the following Rack app: | |||
""" | |||
require 'sinatra/base' | |||
require 'hoptoad_notifier' | |||
HoptoadNotifier.configure do |config| | |||
config.api_key = 'my_api_key' | |||
end | |||
class FontaneApp < Sinatra::Default | |||
use HoptoadNotifier::Rack | |||
enable :raise_errors | |||
get "/test/index" do | |||
raise "Sinatra has left the building" | |||
end | |||
end | |||
app = FontaneApp | |||
""" | |||
When I perform a Rack request to "http://example.com:123/test/index?param=value" | |||
Then I should receive the following Hoptoad notification: | |||
| error message | RuntimeError: Sinatra has left the building | | |||
| error class | RuntimeError | | |||
| parameters | param: value | | |||
| url | http://example.com:123/test/index?param=value | | |||
|