Merge pull request #1505 from arunagw/3-1-stable

Cherry-picked from master to fix the build
This commit is contained in:
José Valim
2011-06-06 03:53:01 -07:00
3 changed files with 18 additions and 0 deletions

View File

@@ -4,10 +4,16 @@ 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 teardown
ENV['RAILS_ENV'] = @prev_rails_env
end
def load_environment(sandbox = false)
require "#{rails_root}/config/environment"
Rails.application.sandbox = sandbox

View File

@@ -5,11 +5,17 @@ module ApplicationTests
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

View File

@@ -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