From c968f908e177e0a216dd6d0a45ee72b19a3b26a0 Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 27 May 2014 14:51:08 +0000 Subject: * lib/cgi/core.rb: Use Tempfile#close(true) instead of Tempfile#unlink to close file descriptors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/cgi/test_cgi_multipart.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/cgi') diff --git a/test/cgi/test_cgi_multipart.rb b/test/cgi/test_cgi_multipart.rb index ea40535dfd..627f16642c 100644 --- a/test/cgi/test_cgi_multipart.rb +++ b/test/cgi/test_cgi_multipart.rb @@ -118,7 +118,7 @@ class CGIMultipartTest < Test::Unit::TestCase $stdin.close() if $stdin.is_a?(Tempfile) $stdin = STDIN @tempfiles.each {|t| - t.unlink + t.close(true) } end @@ -179,7 +179,7 @@ class CGIMultipartTest < Test::Unit::TestCase cgi.params.each {|name, vals| vals.each {|val| if val.kind_of?(Tempfile) && val.path - val.unlink + val.close(true) end } } @@ -330,7 +330,7 @@ class CGIMultipartTest < Test::Unit::TestCase cgi = RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new assert_equal(cgi['foo'], 'bar') assert_equal(cgi['file'].read, 'b'*10134) - cgi['file'].unlink if cgi['file'].kind_of? Tempfile + cgi['file'].close(true) if cgi['file'].kind_of? Tempfile end def test_cgi_multipart_without_tempfile -- cgit v1.2.3