diff options
Diffstat (limited to 'test/test_tempfile.rb')
-rw-r--r-- | test/test_tempfile.rb | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb index 6b7860fe20..fb1027ba78 100644 --- a/test/test_tempfile.rb +++ b/test/test_tempfile.rb @@ -379,8 +379,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 @@ -388,8 +394,14 @@ 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! + t&.close! end def test_create_traversal_dir @@ -397,5 +409,11 @@ puts Tempfile.new('foo').path 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 end end |