aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/isolation
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-06-06 13:54:05 +0100
committerJon Leighton <j@jonathanleighton.com>2011-06-06 13:54:05 +0100
commit62570e8626c67f9d38b28246304b938aab9d9fbe (patch)
tree4ec99ea7f7c583423dd3eafa68d74e52c3b5db41 /railties/test/isolation
parent2d3ba54b86a7307d01fbe364ed831de428cabeba (diff)
downloadrails-62570e8626c67f9d38b28246304b938aab9d9fbe.tar.gz
rails-62570e8626c67f9d38b28246304b938aab9d9fbe.tar.bz2
rails-62570e8626c67f9d38b28246304b938aab9d9fbe.zip
Solve the RAILS_ENV problem in the railties tests in a more generic way
Diffstat (limited to 'railties/test/isolation')
-rw-r--r--railties/test/isolation/abstract_unit.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index 69208ce4c3..c0233c5f90 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -91,6 +91,8 @@ module TestHelpers
module Generation
# Build an application by invoking the generator and going through the whole stack.
def build_app(options = {})
+ @prev_rails_env = ENV.delete('RAILS_ENV')
+
FileUtils.rm_rf(app_path)
FileUtils.cp_r(tmp_path('app_template'), app_path)
@@ -115,6 +117,10 @@ module TestHelpers
add_to_config 'config.secret_token = "3b7cd727ee24e8444053437c36cc66c4"; config.session_store :cookie_store, :key => "_myapp_session"; config.active_support.deprecation = :log'
end
+ def teardown_app
+ ENV['RAILS_ENV'] = @prev_rails_env if @prev_rails_env
+ end
+
# Make a very basic app, without creating the whole directory structure.
# This is faster and simpler than the method above.
def make_basic_app