$defout and $deferr are not changed when $stdout and $stderr modified
---------------------------------------------------------------------

                 Key: JRUBY-1849
                 URL: http://jira.codehaus.org/browse/JRUBY-1849
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.x
         Environment: Latest JRuby 1.1b1
            Reporter: Vladimir Sizikov
         Attachments: defout-deferr-values.patch

Consider the following example, where $stdout and $stderr are redefined, but 
$defout and $deferr are not.

{noformat}
class CaptureOutput < String
  def write(*str)
    self << str.to_s
  end
end

$stdout = CaptureOutput.new
$stderr = CaptureOutput.new

$defout.puts "DEFOUT\n"
$deferr.write "DEFERR\n"
{noformat}

MRI 1.8.6, MRI 1.9 print nothing.
JRuby prints:
DEFOUT
DEFERR

This leads to additional noise when running rubinius specs for getoptlong:
{noformat}
#>bin/mspec -V -t j ruby/spec/1.8/library/getoptlong/
Started

ruby/spec/1.8/library/getoptlong//each_option_spec.rb.
ruby/spec/1.8/library/getoptlong//each_spec.rb.
ruby/spec/1.8/library/getoptlong//error_message_spec.rb.tmp/last_mspec.rb: 
argument error
.
ruby/spec/1.8/library/getoptlong//get_option_spec.rb...tmp/last_mspec.rb: 
option `--size' requires an argument
.
ruby/spec/1.8/library/getoptlong//get_spec.rb...tmp/last_mspec.rb: option 
`--size' requires an argument
.
ruby/spec/1.8/library/getoptlong//initialize_spec.rb..
ruby/spec/1.8/library/getoptlong//ordering_spec.rbtmp/last_mspec.rb: argument 
error
{noformat}

The proposed patch fixes the problem and eliminates the extra noise when 
running the specs.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to