From b51673fbd9563bd3ffa22e22255ca1cef80cfb6d Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Mon, 25 Feb 2013 17:04:01 -0500 Subject: Update Rake tasks to call `rails test` instead Also, print out deprecation warning for other rake tasks except `rake test` and `rake` (default) --- railties/test/application/rake_test.rb | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'railties/test/application/rake_test.rb') diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 09f2ad1209..a9e0e1bcb7 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -91,19 +91,9 @@ module ApplicationTests raise 'models' RUBY - app_file "test/controllers/one_controller_test.rb", <<-RUBY - raise 'controllers' - RUBY - - app_file "test/integration/one_integration_test.rb", <<-RUBY - raise 'integration' - RUBY - silence_stderr do output = Dir.chdir(app_path) { `rake test 2>&1` } assert_match 'models', output - assert_match 'controllers', output - assert_match 'integration', output end end @@ -135,6 +125,19 @@ module ApplicationTests end end + def test_rake_test_deprecation_messages + Dir.chdir(app_path){ `rails generate scaffold user name:string` } + Dir.chdir(app_path){ `rake db:migrate` } + + %w(run recent uncommitted models helpers units controllers functionals integration).each do |test_suit_name| + output = Dir.chdir(app_path) { `rake test:#{test_suit_name} 2>&1` } + assert_match /DEPRECATION WARNING: `rake test:#{test_suit_name}` is deprecated/, output + end + + assert_match /DEPRECATION WARNING: `rake test:single` is deprecated/, + Dir.chdir(app_path) { `rake test:single TEST=test/models/user_test.rb 2>&1` } + end + def test_rake_routes_calls_the_route_inspector app_file "config/routes.rb", <<-RUBY AppTemplate::Application.routes.draw do -- cgit v1.2.3