mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Disable :show_exceptions on Base in all environments
See http://tinyurl.com/l7lvnl for ML discussion on this.
This commit is contained in:
parent
3b27482a37
commit
b2ed12c0d2
2 changed files with 9 additions and 3 deletions
|
@ -941,7 +941,7 @@ module Sinatra
|
|||
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
|
||||
|
@ -1012,6 +1012,7 @@ module Sinatra
|
|||
# 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? }
|
||||
|
|
|
@ -183,10 +183,15 @@ class OptionsTest < Test::Unit::TestCase
|
|||
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?
|
||||
|
||||
|
|
Loading…
Reference in a new issue