diff options
author | José Valim <jose.valim@gmail.com> | 2011-06-29 10:01:13 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-06-29 10:01:13 -0700 |
commit | c49d1f2b265173fee7ed90211baa164d79f39fb1 (patch) | |
tree | 20209681881dc23718da675f3ead74372ae41747 /railties/test | |
parent | d677097eb6d49f75ef41dae2ee832d5e0a1d177d (diff) | |
parent | db87e48b5e7908585a82bdd09e0947be19a4abd6 (diff) | |
download | rails-c49d1f2b265173fee7ed90211baa164d79f39fb1.tar.gz rails-c49d1f2b265173fee7ed90211baa164d79f39fb1.tar.bz2 rails-c49d1f2b265173fee7ed90211baa164d79f39fb1.zip |
Merge pull request #1899 from ihower/patch_rake_test
Make "rake test" display not only task name but also exception message.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/rake_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 44ac6615de..b61e2851bf 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -59,6 +59,32 @@ module ApplicationTests Dir.chdir(app_path){ `rake stats` } end + def test_rake_test_error_output + Dir.chdir(app_path){ `rake db:migrate` } + + app_file "config/database.yml", <<-RUBY + development: + RUBY + + app_file "test/unit/one_unit_test.rb", <<-RUBY + RUBY + + app_file "test/functional/one_functional_test.rb", <<-RUBY + raise RuntimeError + RUBY + + app_file "test/integration/one_integration_test.rb", <<-RUBY + raise RuntimeError + RUBY + + silence_stderr do + output = Dir.chdir(app_path){ `rake test` } + assert_match /Errors running test:units! #<ActiveRecord::AdapterNotSpecified/, output + assert_match /Errors running test:functionals! #<RuntimeError/, output + assert_match /Errors running test:integration! #<RuntimeError/, output + end + end + def test_rake_routes_output_strips_anchors_from_http_verbs app_file "config/routes.rb", <<-RUBY AppTemplate::Application.routes.draw do |