summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/test_tempfile.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb
index 27263fca80..203059e41c 100644
--- a/test/test_tempfile.rb
+++ b/test/test_tempfile.rb
@@ -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