summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pathname/test_pathname.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 46a04ee2b6..8a0f3cbb66 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -1067,6 +1067,21 @@ class TestPathname < Test::Unit::TestCase
def test_split
assert_equal([Pathname("dirname"), Pathname("basename")], Pathname("dirname/basename").split)
+
+ assert_separately([], <<-'end;')
+ require 'pathname'
+
+ mod = Module.new do
+ def split(_arg)
+ end
+ end
+
+ File.singleton_class.prepend(mod)
+
+ assert_raise(TypeError) do
+ Pathname('/').split
+ end
+ end;
end
def test_blockdev?