diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-07 23:17:23 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-07 23:17:23 +0200 |
commit | a210aff210616922063c89680219bb45581cc217 (patch) | |
tree | 7fe25f6e71beccb08b515c69016f726abd03bcbe /railties | |
parent | 981f81275be8e0f38a35c397b41a209b0e14973c (diff) | |
download | rails-a210aff210616922063c89680219bb45581cc217.tar.gz rails-a210aff210616922063c89680219bb45581cc217.tar.bz2 rails-a210aff210616922063c89680219bb45581cc217.zip |
Add delete to middleware stack proxy.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/configuration.rb | 4 | ||||
-rw-r--r-- | railties/test/application/middleware_test.rb | 6 | ||||
-rw-r--r-- | railties/test/isolation/abstract_unit.rb | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index ee0fca6592..0becb780de 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -28,6 +28,10 @@ module Rails @operations << [:use, args, block] end + def delete(*args, &block) + @operations << [:delete, args, block] + end + def merge_into(other) @operations.each do |operation, args, block| other.send(operation, *args, &block) diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb index bab17d8af5..aa75fed793 100644 --- a/railties/test/application/middleware_test.rb +++ b/railties/test/application/middleware_test.rb @@ -57,6 +57,12 @@ module ApplicationTests assert !middleware.include?("ActionDispatch::Static") end + test "can delete a middleware from the stack" do + add_to_config "config.middleware.delete ActionDispatch::Static" + boot! + assert !middleware.include?("ActionDispatch::Static") + end + test "removes show exceptions if action_dispatch.show_exceptions is disabled" do add_to_config "config.action_dispatch.show_exceptions = false" boot! diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index 6f4c5d77f3..b46ac0efaf 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -232,7 +232,7 @@ Module.new do require_environment = "-r #{environment}" end - `#{Gem.ruby} #{require_environment} #{RAILS_FRAMEWORK_ROOT}/bin/rails #{tmp_path('app_template')}` + `#{Gem.ruby} #{require_environment} #{RAILS_FRAMEWORK_ROOT}/bin/rails new #{tmp_path('app_template')}` File.open("#{tmp_path}/app_template/config/boot.rb", 'w') do |f| if require_environment f.puts "Dir.chdir('#{File.dirname(environment)}') do" |