IO.puts doesn't follow the specification
----------------------------------------

                 Key: JRUBY-1669
                 URL: http://jira.codehaus.org/browse/JRUBY-1669
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.x
         Environment: JRuby 1.1b1, latest trunk
            Reporter: Vladimir Sizikov
         Attachments: io_puts.diff

Ruby-doc for IO.puts states:
"Writes the given objects to ios as with IO#print. Writes a record separator 
(typically a newline) after any that do not already end with a newline 
sequence".

So, according to the spec, IO.puts(5) should result in two calls, first writing 
5, and then the newline.
A number of Rubinius spec tests verify that. And both Ruby 1.8.6 and Ruby 1.9 
follow this behavior.

But JRuby doesn't follow this behavior, writing in one go.

This causes 7 Rubinius IO spec tests to fail.

The proposed patch fixes the problem. All 7 IO Rubinius specs pass with this 
patch applied.


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