mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	[ruby/fileutils] Make verbose output go to stdout instead of stderr
Verbose output is not error output, and should be sent to
stdout and not stderr.
Fixes Ruby bug 4436
563a383025
			
			
This commit is contained in:
		
							parent
							
								
									e2678781c7
								
							
						
					
					
						commit
						7cddb844e6
					
				
					 2 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -1615,7 +1615,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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1720,16 +1720,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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue