summaryrefslogtreecommitdiff
path: root/test/pathname
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-23 14:16:06 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-23 14:16:06 +0000
commit526d246f715a1a0046942f942173c2d9447e78a5 (patch)
tree26a3ea7aed8c729dbf0d6425cc0d64683a5222ca /test/pathname
parent645114b25c067f88c5d7e15e850f671272487b7d (diff)
* ext/pathname/pathname.c (path_each_line): Pathname#each_line
translated from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/pathname')
-rw-r--r--test/pathname/test_pathname.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 9adecb5..8634c48 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -670,6 +670,23 @@ class TestPathname < Test::Unit::TestCase
a = []
Pathname("a").each_line {|line| a << line }
assert_equal(["1\n", "2\n"], a)
+
+ a = []
+ Pathname("a").each_line("2") {|line| a << line }
+ assert_equal(["1\n2", "\n"], a)
+
+ a = []
+ Pathname("a").each_line(1) {|line| a << line }
+ assert_equal(["1", "\n", "2", "\n"], a)
+
+ a = []
+ Pathname("a").each_line("2", 1) {|line| a << line }
+ assert_equal(["1", "\n", "2", "\n"], a)
+
+ a = []
+ enum = Pathname("a").each_line
+ enum.each {|line| a << line }
+ assert_equal(["1\n", "2\n"], a)
}
end