Skip to content
Browse files

Disable :show_exceptions on Base in all environments

See http://tinyurl.com/l7lvnl for ML discussion on this.
  • Loading branch information...
1 parent 4101cce commit e997abbb1939f71db12ed41a69c503593f16bf75 @rtomayko rtomayko committed Jun 5, 2009
Showing with 9 additions and 3 deletions.
  1. +2 −1 lib/sinatra/base.rb
  2. +7 −2 test/options_test.rb
View
3 lib/sinatra/base.rb
@@ -977,7 +977,7 @@ def caller_locations
set :raise_errors, true
set :dump_errors, false
set :clean_trace, true
- set :show_exceptions, Proc.new { development? }
+ set :show_exceptions, false
set :sessions, false
set :logging, false
set :methodoverride, false
@@ -1048,6 +1048,7 @@ def caller_locations
# Base class for classic style (top-level) applications.
class Default < Base
set :raise_errors, Proc.new { test? }
+ set :show_exceptions, Proc.new { development? }
set :dump_errors, true
set :sessions, false
set :logging, Proc.new { ! test? }
View
9 test/options_test.rb
@@ -183,10 +183,15 @@ def clean_backtrace(trace)
end
describe 'show_exceptions' do
+ %w[development test production none].each do |environment|
+ it "is disabled on Base in #{environment} environments" do
+ @base.set(:environment, environment)
+ assert ! @base.show_exceptions?
+ end
+ end
+
it 'is enabled on Default only in development' do
@base.set(:environment, :development)
- assert @base.show_exceptions?
-
assert @default.development?
assert @default.show_exceptions?

0 comments on commit e997abb

Please sign in to comment.
Something went wrong with that request. Please try again.