aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/initializer_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/initializer_test.rb')
-rw-r--r--railties/test/initializer_test.rb21
1 files changed, 9 insertions, 12 deletions
diff --git a/railties/test/initializer_test.rb b/railties/test/initializer_test.rb
index 4c25ad8a0a..86f7569c50 100644
--- a/railties/test/initializer_test.rb
+++ b/railties/test/initializer_test.rb
@@ -15,22 +15,19 @@ class InitializerTest < Test::Unit::TestCase
def environment_path
@envpath
end
- end
- def setup
- Object.const_set(:RAILS_ROOT, "") rescue nil
- end
-
- def teardown
- Object.remove_const(:RAILS_ROOT) rescue nil
+ protected
+ def root_path
+ File.dirname(__FILE__)
+ end
end
-
+
def test_load_environment_with_constant
config = ConfigurationMock.new("#{File.dirname(__FILE__)}/fixtures/environment_with_constant.rb")
+ assert_nil $initialize_test_set_from_env
Rails::Initializer.run(:load_environment, config)
- assert Object.const_defined?(:SET_FROM_ENV)
- assert_equal "success", SET_FROM_ENV
+ assert_equal "success", $initialize_test_set_from_env
ensure
- Object.remove_const(:SET_FROM_ENV) rescue nil
+ $initialize_test_set_from_env = nil
end
-end \ No newline at end of file
+end