Permalink
Browse files

Fix String#each_line and String#lines specs.

  • Loading branch information...
1 parent 69f4953 commit 602c1f2872b2a39aded0680c92409fb321bc6509 @BanzaiMan BanzaiMan committed Jun 8, 2010
@@ -1 +0,0 @@
-fails:String#each_line raises a TypeError when the separator is a symbol
@@ -1 +0,0 @@
-fails:String#lines raises a TypeError when the separator is a symbol
@@ -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();

0 comments on commit 602c1f2

Please sign in to comment.