From 92f449271bcd6cedddb06e024c9cf742f8d4a185 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Tue, 13 May 2014 15:22:09 -0700 Subject: [PATCH] Test display_exception_details Part of #272 --- test/test_rake_application.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index e639980df..8255083ce 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -16,6 +16,22 @@ def setup_command_line(*options) end end + def test_display_exception_details + begin + raise 'test' + rescue => ex + end + + out, err = capture_io do + @app.display_error_message ex + end + + assert_empty out + + assert_match 'rake aborted!', err + assert_match __method__.to_s, err + end + def test_display_tasks @app.options.show_tasks = :tasks @app.options.show_task_pattern = //