@@ -48,7 +48,7 @@ def test_display_exception_details
4848 rescue => ex
4949 end
5050
51- out , err = capture_io do
51+ out , err = capture_output do
5252 @app . set_default_options # reset trace output IO
5353
5454 @app . display_error_message ex
@@ -72,7 +72,7 @@ def detailed_message(**)
7272 rescue error_class => ex
7373 end
7474
75- out , err = capture_io do
75+ out , err = capture_output do
7676 @app . set_default_options # reset trace output IO
7777
7878 @app . display_error_message ex
@@ -91,7 +91,7 @@ def test_display_exception_details_bad_encoding
9191 rescue => ex
9292 end
9393
94- out , err = capture_io do
94+ out , err = capture_output do
9595 @app . set_default_options # reset trace output IO
9696
9797 @app . display_error_message ex
@@ -111,7 +111,7 @@ def test_display_exception_details_cause
111111 end
112112 end
113113
114- out , err = capture_io do
114+ out , err = capture_output do
115115 @app . set_default_options # reset trace output IO
116116
117117 @app . display_error_message ex
@@ -129,7 +129,7 @@ def test_display_tasks
129129 @app . options . show_task_pattern = //
130130 @app . last_description = "COMMENT"
131131 @app . define_task ( Rake ::Task , "t" )
132- out , = capture_io do @app . instance_eval { display_tasks_and_comments } end
132+ out , = capture_output do @app . instance_eval { display_tasks_and_comments } end
133133 assert_match ( /^rake t/ , out )
134134 assert_match ( /# COMMENT/ , out )
135135 end
@@ -142,7 +142,7 @@ def test_display_tasks_with_long_comments
142142 @app . last_description = numbers
143143 @app . define_task ( Rake ::Task , "t" )
144144
145- out , = capture_io do @app . instance_eval { display_tasks_and_comments } end
145+ out , = capture_output do @app . instance_eval { display_tasks_and_comments } end
146146
147147 assert_match ( /^rake t/ , out )
148148 assert_match ( /# #{ numbers [ 0 , 65 ] } \. \. \. / , out )
@@ -156,7 +156,7 @@ def test_display_tasks_with_task_name_wider_than_tty_display
156156 @app . last_description = "something short"
157157 @app . define_task ( Rake ::Task , task_name )
158158
159- out , = capture_io do @app . instance_eval { display_tasks_and_comments } end
159+ out , = capture_output do @app . instance_eval { display_tasks_and_comments } end
160160
161161 # Ensure the entire task name is output and we end up showing no description
162162 assert_match ( /rake #{ task_name } # .../ , out )
@@ -171,7 +171,7 @@ def test_display_tasks_with_very_long_task_name_to_a_non_tty_shows_name_and_comm
171171 @app . last_description = "something short"
172172 @app . define_task ( Rake ::Task , task_name )
173173
174- out , = capture_io do @app . instance_eval { display_tasks_and_comments } end
174+ out , = capture_output do @app . instance_eval { display_tasks_and_comments } end
175175
176176 # Ensure the entire task name is output and we end up showing no description
177177 assert_match ( /rake #{ task_name } # #{ description } / , out )
@@ -183,7 +183,7 @@ def test_display_tasks_with_long_comments_to_a_non_tty_shows_entire_comment
183183 @app . tty_output = false
184184 @app . last_description = "1234567890" * 8
185185 @app . define_task ( Rake ::Task , "t" )
186- out , = capture_io do @app . instance_eval { display_tasks_and_comments } end
186+ out , = capture_output do @app . instance_eval { display_tasks_and_comments } end
187187 assert_match ( /^rake t/ , out )
188188 assert_match ( /# #{ @app . last_description } / , out )
189189 end
@@ -197,7 +197,7 @@ def test_truncating_comments_to_a_non_tty
197197 @app . last_description = numbers
198198 @app . define_task ( Rake ::Task , "t" )
199199
200- out , = capture_io do @app . instance_eval { display_tasks_and_comments } end
200+ out , = capture_output do @app . instance_eval { display_tasks_and_comments } end
201201
202202 assert_match ( /^rake t/ , out )
203203 assert_match ( /# #{ numbers [ 0 , 65 ] } \. \. \. / , out )
@@ -208,7 +208,7 @@ def test_describe_tasks
208208 @app . options . show_task_pattern = //
209209 @app . last_description = "COMMENT"
210210 @app . define_task ( Rake ::Task , "t" )
211- out , = capture_io do @app . instance_eval { display_tasks_and_comments } end
211+ out , = capture_output do @app . instance_eval { display_tasks_and_comments } end
212212 assert_match ( /^rake t$/ , out )
213213 assert_match ( /^ {4}COMMENT$/ , out )
214214 end
@@ -219,7 +219,7 @@ def test_show_lines
219219 @app . last_description = "COMMENT"
220220 @app . define_task ( Rake ::Task , "t" )
221221 @app [ "t" ] . locations << "HERE:1"
222- out , = capture_io do @app . instance_eval { display_tasks_and_comments } end
222+ out , = capture_output do @app . instance_eval { display_tasks_and_comments } end
223223 assert_match ( /^rake t +[^:]+:\d + *$/ , out )
224224 end
225225
@@ -251,7 +251,7 @@ def test_load_rakefile
251251 def test_load_rakefile_doesnt_print_rakefile_directory_from_same_dir
252252 rakefile_unittest
253253
254- _ , err = capture_io do
254+ _ , err = capture_output do
255255 @app . instance_eval do
256256 # pretend we started from the unittest dir
257257 @original_dir = File . expand_path ( "." )
@@ -283,7 +283,7 @@ def test_load_rakefile_prints_rakefile_directory_from_subdir
283283 app = Rake ::Application . new
284284 app . options . rakelib = [ ]
285285
286- _ , err = capture_io do
286+ _ , err = capture_output do
287287 app . instance_eval do
288288 raw_load_rakefile
289289 end
@@ -296,7 +296,7 @@ def test_load_rakefile_doesnt_print_rakefile_directory_from_subdir_if_silent
296296 rakefile_unittest
297297 Dir . chdir "subdir"
298298
299- _ , err = capture_io do
299+ _ , err = capture_output do
300300 @app . instance_eval do
301301 handle_options [ ]
302302 options . silent = true
@@ -308,7 +308,7 @@ def test_load_rakefile_doesnt_print_rakefile_directory_from_subdir_if_silent
308308 end
309309
310310 def test_load_rakefile_not_found
311- skip if jruby9?
311+ omit if jruby9?
312312
313313 Dir . chdir @tempdir
314314 ENV [ "RAKE_SYSTEM" ] = "not_exist"
@@ -455,7 +455,7 @@ def test_good_run
455455
456456 rakefile_default
457457
458- out , err = capture_io do
458+ out , err = capture_output do
459459 @app . run %w[ --rakelib="" ]
460460 end
461461
@@ -468,7 +468,7 @@ def test_display_task_run
468468 ran = false
469469 @app . last_description = "COMMENT"
470470 @app . define_task ( Rake ::Task , "default" )
471- out , = capture_io { @app . run %w[ -f -s --tasks --rakelib="" ] }
471+ out , = capture_output { @app . run %w[ -f -s --tasks --rakelib="" ] }
472472 assert @app . options . show_tasks
473473 assert ! ran
474474 assert_match ( /rake default/ , out )
@@ -482,7 +482,7 @@ def test_display_prereqs
482482 t . enhance ( [ :a , :b ] )
483483 @app . define_task ( Rake ::Task , "a" )
484484 @app . define_task ( Rake ::Task , "b" )
485- out , = capture_io { @app . run %w[ -f -s --prereqs --rakelib="" ] }
485+ out , = capture_output { @app . run %w[ -f -s --prereqs --rakelib="" ] }
486486 assert @app . options . show_prereqs
487487 assert ! ran
488488 assert_match ( /rake a$/ , out )
@@ -492,15 +492,15 @@ def test_display_prereqs
492492
493493 def test_bad_run
494494 @app . intern ( Rake ::Task , "default" ) . enhance { fail }
495- _ , err = capture_io {
495+ _ , err = capture_output {
496496 assert_raises ( SystemExit ) { @app . run %w[ -f -s --rakelib="" ] }
497497 }
498498 assert_match ( /see full trace/i , err )
499499 end
500500
501501 def test_bad_run_with_trace
502502 @app . intern ( Rake ::Task , "default" ) . enhance { fail }
503- _ , err = capture_io {
503+ _ , err = capture_output {
504504 @app . set_default_options
505505 assert_raises ( SystemExit ) { @app . run %w[ -f -s -t ] }
506506 }
@@ -509,7 +509,7 @@ def test_bad_run_with_trace
509509
510510 def test_bad_run_with_backtrace
511511 @app . intern ( Rake ::Task , "default" ) . enhance { fail }
512- _ , err = capture_io {
512+ _ , err = capture_output {
513513 assert_raises ( SystemExit ) {
514514 @app . run %w[ -f -s --backtrace ]
515515 }
@@ -523,7 +523,7 @@ def test_bad_run_includes_exception_name
523523 @app . intern ( Rake ::Task , "default" ) . enhance {
524524 raise CustomError , "intentional"
525525 }
526- _ , err = capture_io {
526+ _ , err = capture_output {
527527 assert_raises ( SystemExit ) {
528528 @app . run %w[ -f -s ]
529529 }
@@ -535,7 +535,7 @@ def test_rake_error_excludes_exception_name
535535 @app . intern ( Rake ::Task , "default" ) . enhance {
536536 fail "intentional"
537537 }
538- _ , err = capture_io {
538+ _ , err = capture_output {
539539 assert_raises ( SystemExit ) {
540540 @app . run %w[ -f -s ]
541541 }
@@ -558,7 +558,7 @@ def test_printing_original_exception_cause
558558 raise custom_error , "Secondary Error"
559559 end
560560 }
561- _ , err = capture_io {
561+ _ , err = capture_output {
562562 assert_raises ( SystemExit ) {
563563 @app . run %w[ -f -s ]
564564 }
@@ -572,12 +572,12 @@ def test_printing_original_exception_cause
572572 def test_run_with_bad_options
573573 @app . intern ( Rake ::Task , "default" ) . enhance { fail }
574574 assert_raises ( SystemExit ) {
575- capture_io { @app . run %w[ -f -s --xyzzy ] }
575+ capture_output { @app . run %w[ -f -s --xyzzy ] }
576576 }
577577 end
578578
579579 def test_standard_exception_handling_invalid_option
580- out , err = capture_io do
580+ out , err = capture_output do
581581 e = assert_raises SystemExit do
582582 @app . standard_exception_handling do
583583 raise OptionParser ::InvalidOption , "blah"
@@ -592,7 +592,7 @@ def test_standard_exception_handling_invalid_option
592592 end
593593
594594 def test_standard_exception_handling_other
595- out , err = capture_io do
595+ out , err = capture_output do
596596 @app . set_default_options # reset trace output IO
597597
598598 e = assert_raises SystemExit do
@@ -610,7 +610,7 @@ def test_standard_exception_handling_other
610610 end
611611
612612 def test_standard_exception_handling_system_exit
613- out , err = capture_io do
613+ out , err = capture_output do
614614 e = assert_raises SystemExit do
615615 @app . standard_exception_handling do
616616 exit 0
@@ -625,7 +625,7 @@ def test_standard_exception_handling_system_exit
625625 end
626626
627627 def test_standard_exception_handling_system_exit_nonzero
628- out , err = capture_io do
628+ out , err = capture_output do
629629 e = assert_raises SystemExit do
630630 @app . standard_exception_handling do
631631 exit 5
0 commit comments