File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,33 @@ def test_display_exception_details
6060 assert_match __method__ . to_s , err
6161 end
6262
63+ if Exception . method_defined? ( :detailed_message )
64+ def test_display_exception_details_with_detailed_message
65+ error_class = Class . new ( StandardError ) do
66+ def detailed_message ( **)
67+ "detailed_message!!"
68+ end
69+ end
70+
71+ begin
72+ raise error_class
73+ rescue error_class => ex
74+ end
75+
76+ out , err = capture_io do
77+ @app . set_default_options # reset trace output IO
78+
79+ @app . display_error_message ex
80+ end
81+
82+ assert_empty out
83+
84+ assert_match "rake aborted!" , err
85+ assert_match "detailed_message!!" , err
86+ assert_match __method__ . to_s , err
87+ end
88+ end
89+
6390 def test_display_exception_details_bad_encoding
6491 begin
6592 raise "El Niño is coming!" . dup . force_encoding ( "US-ASCII" )
You can’t perform that action at this time.
0 commit comments