Browse files

Merge pull request #10195 from jetthoughts/eager_load_on_rake_executi…

…on_tests

Added tests for `eager_load` config option rake tasks
  • Loading branch information...
2 parents 70db385 + a49d935 commit c7673b0981d961e5510c85d958c944876d543314 @josevalim josevalim committed Apr 12, 2013
Showing with 17 additions and 0 deletions.
  1. +17 −0 railties/test/application/rake_test.rb
View
17 railties/test/application/rake_test.rb
@@ -79,6 +79,23 @@ def world
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` }

0 comments on commit c7673b0

Please sign in to comment.