diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-07-28 14:02:10 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-07-28 14:02:10 +0000 |
commit | 4913edde489968e76956e279f60bad5a374cd817 (patch) | |
tree | 5016c678fde04385ef0dd89a22a8df8bee4814a6 /test | |
parent | e678e6eef7a29d34d8bc6380cc650a0bdbe56767 (diff) |
merge revision(s) dcb6a6ae3e2b8a3e298e7f0d4a3e7f8ff102a30e: [Backport #15845]
Windows simply causes an error to open invalid path
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/test_tempfile.rb | 20 |
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 |