diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-29 05:44:44 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-29 05:44:44 +0000 |
commit | 29d63a04acabf398aa161857b603d99a2bf8e51b (patch) | |
tree | bff68236464ae18761009a84ec7bb1b17eade218 /railties | |
parent | 0cac2806a6fd9f1f63cdce8d3fd1e86cefb22c1f (diff) | |
download | rails-29d63a04acabf398aa161857b603d99a2bf8e51b.tar.gz rails-29d63a04acabf398aa161857b603d99a2bf8e51b.tar.bz2 rails-29d63a04acabf398aa161857b603d99a2bf8e51b.zip |
Canonicalize configuration.root_path and replace RAILS_ROOT.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6488 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/initializer.rb | 2 | ||||
-rw-r--r-- | railties/test/fixtures/environment_with_constant.rb | 2 | ||||
-rw-r--r-- | railties/test/initializer_test.rb | 19 |
3 files changed, 7 insertions, 16 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 4f09dd45a3..6b9a5ae2ae 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -502,6 +502,8 @@ module Rails else Pathname.new(::RAILS_ROOT).realpath.to_s end + + ::RAILS_ROOT.replace @root_path end # Loads and returns the contents of the #database_configuration_file. The diff --git a/railties/test/fixtures/environment_with_constant.rb b/railties/test/fixtures/environment_with_constant.rb index 1c7120655e..23e1f7afd9 100644 --- a/railties/test/fixtures/environment_with_constant.rb +++ b/railties/test/fixtures/environment_with_constant.rb @@ -1 +1 @@ -$initialize_test_set_from_env = "success" +$initialize_test_set_from_env = 'success' diff --git a/railties/test/initializer_test.rb b/railties/test/initializer_test.rb index 86f7569c50..cf333e878e 100644 --- a/railties/test/initializer_test.rb +++ b/railties/test/initializer_test.rb @@ -1,25 +1,14 @@ -$:.unshift File.dirname(__FILE__) + "/../lib" -$:.unshift File.dirname(__FILE__) + "/../../activesupport/lib" - -require 'test/unit' -require 'active_support' +require "#{File.dirname(__FILE__)}/abstract_unit" require 'initializer' class InitializerTest < Test::Unit::TestCase class ConfigurationMock < Rails::Configuration + attr_reader :environment_path + def initialize(envpath) super() - @envpath = envpath + @environment_path = envpath end - - def environment_path - @envpath - end - - protected - def root_path - File.dirname(__FILE__) - end end def test_load_environment_with_constant |