diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG.md | 2 | ||||
-rw-r--r-- | railties/test/app_rails_loader_test.rb | 9 | ||||
-rw-r--r-- | railties/test/application/rake_test.rb | 17 |
3 files changed, 20 insertions, 8 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index e4a08f68c1..f67177a047 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -58,7 +58,7 @@ * Improve service pages with new layout (404, etc). - *Stanislav Sobolev* + *Stanislav Sobolev* ## Rails 4.0.0.beta1 (February 25, 2013) ## diff --git a/railties/test/app_rails_loader_test.rb b/railties/test/app_rails_loader_test.rb index a16b8d3302..ceae78ae80 100644 --- a/railties/test/app_rails_loader_test.rb +++ b/railties/test/app_rails_loader_test.rb @@ -1,11 +1,10 @@ require 'tmpdir' -require 'pathname' require 'abstract_unit' require 'rails/app_rails_loader' class AppRailsLoaderTest < ActiveSupport::TestCase def write(filename, contents=nil) - FileUtils.mkdir_p(Pathname.new(filename).dirname) + FileUtils.mkdir_p(File.dirname(filename)) File.write(filename, contents) end @@ -13,10 +12,6 @@ class AppRailsLoaderTest < ActiveSupport::TestCase Rails::AppRailsLoader.expects(:exec).with(Rails::AppRailsLoader::RUBY, exe) end - def realpath(filename) - Pathname.new(filename).realpath - end - setup do @tmp = Dir.mktmpdir('railties-rails-loader-test-suite') @cwd = Dir.pwd @@ -61,7 +56,7 @@ class AppRailsLoaderTest < ActiveSupport::TestCase # This happens in particular in Mac OS X, where @tmp starts # with "/var", and Dir.pwd with "/private/var", due to a # default system symlink var -> private/var. - assert_equal realpath("#@tmp/foo"), realpath(Dir.pwd) + assert_equal File.realpath("#@tmp/foo"), File.realpath(Dir.pwd) end end end diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index eb590da678..fa3ab969ae 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -79,6 +79,23 @@ module ApplicationTests assert_match "Hello world", output end + def test_should_not_eager_load_model_path_for_rake + add_to_config <<-RUBY + config.eager_load = true + + rake_tasks do + task do_nothing: :environment do + end + end + RUBY + + app_file "app/models/hello.rb", <<-RUBY + raise 'should not be pre-required for rake even `eager_load=true`' + RUBY + + Dir.chdir(app_path){ `rake do_nothing` } + end + def test_code_statistics_sanity assert_match "Code LOC: 5 Test LOC: 0 Code to Test Ratio: 1:0.0", Dir.chdir(app_path){ `rake stats` } |