Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 30 lines (22 sloc) 0.714 kb
d071193 @jferris Added integration/readme coverage of Sinatra apps
jferris authored
1 Feature: Use the notifier in a Sinatra app
2
3 Background:
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
4 Given I have built and installed the "airbrake" gem
d071193 @jferris Added integration/readme coverage of Sinatra apps
jferris authored
5
6 Scenario: Rescue an exception in a Sinatra app
7 Given the following Rack app:
8 """
9 require 'sinatra/base'
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
10 require 'airbrake'
d071193 @jferris Added integration/readme coverage of Sinatra apps
jferris authored
11
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
12 Airbrake.configure do |config|
d071193 @jferris Added integration/readme coverage of Sinatra apps
jferris authored
13 config.api_key = 'my_api_key'
14 end
15
6285f3b @qrush use Sinatra::Default instead of Sinatra::Base
qrush authored
16 class FontaneApp < Sinatra::Base
ceb0feb @jyurek WIP: Hoptoad -> Airbrake
jyurek authored
17 use Airbrake::Rack
d071193 @jferris Added integration/readme coverage of Sinatra apps
jferris authored
18 enable :raise_errors
19
20 get "/test/index" do
21 raise "Sinatra has left the building"
22 end
23 end
24
25 app = FontaneApp
26 """
27 When I perform a Rack request to "http://example.com:123/test/index?param=value"
67fea41 @shime update mocks for rack and sinatra
shime authored
28 Then I should receive a Airbrake notification
d071193 @jferris Added integration/readme coverage of Sinatra apps
jferris authored
29
Something went wrong with that request. Please try again.