Skip to content

Commit

Permalink
Add test for raising TypeError instead of segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Mar 27, 2021
1 parent a71f7d8 commit e29b49e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/pathname/test_pathname.rb
Expand Up @@ -1067,6 +1067,21 @@ def test_expand_path

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?
Expand Down

0 comments on commit e29b49e

Please sign in to comment.