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:
parent
fc3e80cf6d
commit
dcb6a6ae3e
1 changed files with 19 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue