Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make verbose output go to stdout instead of stderr #49

Merged
merged 1 commit into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fileutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,7 @@ def fu_same?(a, b) #:nodoc:

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
Expand Down
10 changes: 5 additions & 5 deletions test/fileutils/test_fileutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1709,16 +1709,16 @@ def test_chdir_verbose_frozen
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
Expand Down