Permalink
Browse files

Merge pull request #1506 from arunagw/3-0-stable

Cherry-picked from master to fix the build
  • Loading branch information...
josevalim committed Jun 6, 2011
2 parents 1debebc + 101f0a6 commit e9b025ef219670cf5657129187c42bb538c65eaf
@@ -4,11 +4,17 @@ class ConsoleTest < Test::Unit::TestCase
include ActiveSupport::Testing::Isolation
def setup
+ @prev_rails_env = ENV['RAILS_ENV']
+ ENV['RAILS_ENV'] = 'development'
build_app
boot_rails
end
- def load_environment
+ def teardown
+ ENV['RAILS_ENV'] = @prev_rails_env
+ end
+
+ def load_environment(sandbox = false)
require "#{rails_root}/config/environment"
Rails.application.load_console
end
@@ -5,11 +5,17 @@ class FrameworlsTest < Test::Unit::TestCase
include ActiveSupport::Testing::Isolation
def setup
+ @prev_rails_env = ENV['RAILS_ENV']
+ ENV['RAILS_ENV'] = 'development'
build_app
boot_rails
FileUtils.rm_rf "#{app_path}/config/environments"
end
+ def teardown
+ ENV['RAILS_ENV'] = @prev_rails_env
+ end
+
# AC & AM
test "set load paths set only if action controller or action mailer are in use" do
assert_nothing_raised NameError do
@@ -4,10 +4,16 @@ class LoadingTest < Test::Unit::TestCase
include ActiveSupport::Testing::Isolation
def setup
+ @prev_rails_env = ENV['RAILS_ENV']
+ ENV['RAILS_ENV'] = 'development'
build_app
boot_rails
end
+ def teardown
+ ENV['RAILS_ENV'] = @prev_rails_env
+ end
+
def app
@app ||= Rails.application
end

0 comments on commit e9b025e

Please sign in to comment.