Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

turn raise_errors on for ease of debugging the sample app

disable it temporarily for the spec that needs that
  • Loading branch information...
commit 64dc372c9417e02003c2258ef451a80e1622e61f 1 parent f72f070
@timocratic timocratic authored
View
6 spec/fixtures/config.ru
@@ -3,8 +3,6 @@ require "rubygems"
$LOAD_PATH.unshift File.dirname(__FILE__)
require "sample_app"
-$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
-require "rack/bug"
-
-use Rack::Bug, :password => "secret"
+#Example usage, but moved inside sample app for easier testing
+#use Rack::Bug, :password => "secret"
run SampleApp
View
9 spec/fixtures/sample_app.rb
@@ -1,7 +1,16 @@
+$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
+require "rack/bug"
+
require "sinatra/base"
class SampleApp < Sinatra::Base
+ use Rack::Bug
+ set :environment, 'test'
+ configure :test do
+ set :raise_errors, true
+ end
+
get "/redirect" do
redirect "/"
end
View
2  spec/rack/toolbar_spec.rb
@@ -37,7 +37,9 @@
end
it "does not modify server errors" do
+ app.disable :raise_errors
response = get "/error"
+ app.enable :raise_errors
response.should_not have_selector("div#rack_bug")
end
View
5 spec/spec_helper.rb
@@ -42,10 +42,7 @@ class Base
end
def app
- Rack::Builder.new do
- use Rack::Bug
- run SampleApp.new
- end
+ SampleApp
end
def have_row(container, key, value = nil)
Please sign in to comment.
Something went wrong with that request. Please try again.