summaryrefslogtreecommitdiff
path: root/test/stringio
diff options
context:
space:
mode:
Diffstat (limited to 'test/stringio')
-rw-r--r--test/stringio/test_stringio.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 144a9f4292..f14b65a8ea 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -584,6 +584,13 @@ class TestStringIO < Test::Unit::TestCase
end
end
+ def test_each_string_sep
+ f = StringIO.new('a||b||c')
+ assert_equal(["a||", "b||", "c"], f.each("||").to_a)
+ f.rewind
+ assert_equal(["a", "b", "c"], f.each("||", chomp: true).to_a)
+ end
+
def test_each
f = StringIO.new("foo\nbar\nbaz\n")
assert_equal(["foo\n", "bar\n", "baz\n"], f.each.to_a)