From 349e79bae02a8a161c06ba5f6fa203d609f6e8b9 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 19 Dec 2020 16:53:18 +0900 Subject: [PATCH] Try to test with rake-13.0.2 again. [ruby/fileutils] Make verbose output go to stdout instead of stderr This reverts commit 510df47f5f7f83918d3aa00316c8a5b959d80d7c. --- lib/fileutils.rb | 2 +- test/fileutils/test_fileutils.rb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 113796a3a3..67a332333f 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1623,7 +1623,7 @@ module FileUtils def fu_output_message(msg) #:nodoc: output = @fileutils_output if defined?(@fileutils_output) - output ||= $stderr + output ||= $stdout if defined?(@fileutils_label) msg = @fileutils_label + msg end diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index fbc8e3dd83..63936d1a05 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -1748,16 +1748,16 @@ class TestFileUtils < Test::Unit::TestCase o.extend(FileUtils) o.singleton_class.send(:public, :chdir) o.freeze - orig_stderr = $stderr - $stderr = StringIO.new + orig_stdout = $stdout + $stdout = StringIO.new o.chdir('.', verbose: true){} - $stderr.rewind - assert_equal(<<-END, $stderr.read) + $stdout.rewind + assert_equal(<<-END, $stdout.read) cd . cd - END ensure - $stderr = orig_stderr if orig_stderr + $stdout = orig_stdout if orig_stdout end def test_getwd