History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-1849
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Charles Oliver Nutter
Reporter: Vladimir Sizikov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JRuby

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

Created: 30/Dec/07 01:38 PM   Updated: 23/Apr/08 10:03 AM
Component/s: Core Classes/Modules
Affects Version/s: JRuby 1.1+
Fix Version/s: JRuby 1.1RC1

Time Tracking:
Not Specified

File Attachments: 1. Text File defout-deferr-values.patch (1.0 kb)

Environment: Latest JRuby 1.1b1

Patch Submitted: Yes


 Description  « Hide
Consider the following example, where $stdout and $stderr are redefined, but $defout and $deferr are not.
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"

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

This leads to additional noise when running rubinius specs for getoptlong:

#>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

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



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Oliver Nutter - 30/Dec/07 04:38 PM
Thanks, it will be nice to quiet the spec run a bit.