Skip to content

Commit

Permalink
Ensure that initializers are executed before loading rake tasks
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <[email protected]>
  • Loading branch information
drogus authored and josevalim committed Nov 18, 2010
1 parent d19768b commit 77fc0cc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions railties/test/application/rake_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ def test_environment_is_required_in_rake_tasks
assert_match "SuperMiddleware", Dir.chdir(app_path){ `rake middleware` }
end

def test_initializers_are_executed_in_rake_tasks
add_to_config <<-RUBY
initializer "do_something" do
puts "Doing something..."
end
rake_tasks do
task :do_nothing => :environment do
end
end
RUBY

output = Dir.chdir(app_path){ `rake do_nothing` }
assert_match "Doing something...", output
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` }
Expand Down

0 comments on commit 77fc0cc

Please sign in to comment.