Windows simply causes an error to open invalid path
This commit is contained in:
parent
fc3e80cf6d
commit
dcb6a6ae3e
@ -381,8 +381,14 @@ puts Tempfile.new('foo').path
|
|||||||
t = Tempfile.open([TRAVERSAL_PATH, 'foo'])
|
t = Tempfile.open([TRAVERSAL_PATH, 'foo'])
|
||||||
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||||
assert_equal expect, actual
|
assert_equal expect, actual
|
||||||
|
rescue Errno::EINVAL
|
||||||
|
if /mswin|mingw/ =~ RUBY_PLATFORM
|
||||||
|
assert "ok"
|
||||||
|
else
|
||||||
|
raise $!
|
||||||
|
end
|
||||||
ensure
|
ensure
|
||||||
t.close!
|
t&.close!
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_new_traversal_dir
|
def test_new_traversal_dir
|
||||||
@ -390,6 +396,12 @@ puts Tempfile.new('foo').path
|
|||||||
t = Tempfile.new(TRAVERSAL_PATH + 'foo')
|
t = Tempfile.new(TRAVERSAL_PATH + 'foo')
|
||||||
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||||
assert_equal expect, actual
|
assert_equal expect, actual
|
||||||
|
rescue Errno::EINVAL
|
||||||
|
if /mswin|mingw/ =~ RUBY_PLATFORM
|
||||||
|
assert "ok"
|
||||||
|
else
|
||||||
|
raise $!
|
||||||
|
end
|
||||||
ensure
|
ensure
|
||||||
t&.close!
|
t&.close!
|
||||||
end
|
end
|
||||||
@ -399,6 +411,12 @@ puts Tempfile.new('foo').path
|
|||||||
t = Tempfile.create(TRAVERSAL_PATH + 'foo')
|
t = Tempfile.create(TRAVERSAL_PATH + 'foo')
|
||||||
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||||
assert_equal expect, actual
|
assert_equal expect, actual
|
||||||
|
rescue Errno::EINVAL
|
||||||
|
if /mswin|mingw/ =~ RUBY_PLATFORM
|
||||||
|
assert "ok"
|
||||||
|
else
|
||||||
|
raise $!
|
||||||
|
end
|
||||||
ensure
|
ensure
|
||||||
if t
|
if t
|
||||||
t.close
|
t.close
|
||||||
|
Loading…
x
Reference in New Issue
Block a user