summaryrefslogtreecommitdiff
path: root/test/pathname
diff options
context:
space:
mode:
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 9adecb5b05..8634c4893d 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