1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Windows simply causes an error to open invalid path

This commit is contained in:
NAKAMURA Usaku 2019-05-01 17:38:09 +09:00
parent fc3e80cf6d
commit dcb6a6ae3e
No known key found for this signature in database
GPG key ID: C5FE8AEA64F81259

View file

@ -381,8 +381,14 @@ puts Tempfile.new('foo').path
t = Tempfile.open([TRAVERSAL_PATH, 'foo'])
actual = Dir.glob(TRAVERSAL_PATH + '*').count
assert_equal expect, actual
rescue Errno::EINVAL
if /mswin|mingw/ =~ RUBY_PLATFORM
assert "ok"
else
raise $!
end
ensure
t.close!
t&.close!
end
def test_new_traversal_dir
@ -390,6 +396,12 @@ puts Tempfile.new('foo').path
t = Tempfile.new(TRAVERSAL_PATH + 'foo')
actual = Dir.glob(TRAVERSAL_PATH + '*').count
assert_equal expect, actual
rescue Errno::EINVAL
if /mswin|mingw/ =~ RUBY_PLATFORM
assert "ok"
else
raise $!
end
ensure
t&.close!
end
@ -399,6 +411,12 @@ puts Tempfile.new('foo').path
t = Tempfile.create(TRAVERSAL_PATH + 'foo')
actual = Dir.glob(TRAVERSAL_PATH + '*').count
assert_equal expect, actual
rescue Errno::EINVAL
if /mswin|mingw/ =~ RUBY_PLATFORM
assert "ok"
else
raise $!
end
ensure
if t
t.close