Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

StringIO#puts should print newline when passed nil 1 or more times #680

Merged
merged 1 commit into from

2 participants

@atambo
Collaborator

No description provided.

@headius headius merged commit 05cc5af into jruby:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
1  spec/tags/1.9/ruby/library/stringio/puts_tags.txt
@@ -1 +0,0 @@
-fails:StringIO#puts when passed 1 or more objects prints a newline when passed nil
View
6 src/org/jruby/ext/stringio/RubyStringIO.java
@@ -661,10 +661,12 @@ public IRubyObject puts(ThreadContext context, IRubyObject[] args) {
}
for (int i = 0; i < args.length; i++) {
- RubyString line;
+ RubyString line = getRuntime().newString();
if (args[i].isNil()) {
- line = getRuntime().newString("nil");
+ if (!getRuntime().is1_9()) {
+ line = getRuntime().newString("nil");
+ }
} else {
IRubyObject tmp = args[i].checkArrayType();
if (!tmp.isNil()) {
Something went wrong with that request. Please try again.