Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix String#each_line and String#lines specs.

  • Loading branch information...
commit 602c1f2872b2a39aded0680c92409fb321bc6509 1 parent 69f4953
@BanzaiMan BanzaiMan authored
View
1  spec/tags/1.9/ruby/core/string/each_line_tags.txt
@@ -1 +0,0 @@
-fails:String#each_line raises a TypeError when the separator is a symbol
View
1  spec/tags/1.9/ruby/core/string/lines_tags.txt
@@ -1 +0,0 @@
-fails:String#lines raises a TypeError when the separator is a symbol
View
3  src/org/jruby/RubyString.java
@@ -6616,6 +6616,9 @@ private IRubyObject each_lineCommon19(ThreadContext context, IRubyObject sep, Bl
block.yield(context, this);
return this;
}
+ if (! sep.respondsTo("to_str")) {
+ throw runtime.newTypeError("can't convert " + sep.getMetaClass() + " into String");
+ }
ByteList val = value.shallowDup();
int p = val.getBegin();
Please sign in to comment.
Something went wrong with that request. Please try again.