ruby-changes:34036
From: akr <ko1@a...>
Date: Sun, 25 May 2014 23:00:28 +0900 (JST)
Subject: [ruby-changes:34036] akr:r46117 (trunk): Avoid tempfile leaks using Tempfile.create instead of Tempfile.open.
akr 2014-05-25 23:00:16 +0900 (Sun, 25 May 2014) New Revision: 46117 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=46117 Log: Avoid tempfile leaks using Tempfile.create instead of Tempfile.open. Modified files: trunk/test/resolv/test_addr.rb trunk/test/resolv/test_dns.rb Index: test/resolv/test_dns.rb =================================================================== --- test/resolv/test_dns.rb (revision 46116) +++ test/resolv/test_dns.rb (revision 46117) @@ -153,7 +153,7 @@ class TestResolvDNS < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/resolv/test_dns.rb#L153 def test_invalid_byte_comment bug9273 = '[ruby-core:59239] [Bug #9273]' - Tempfile.open('resolv_test_dns_') do |tmpfile| + Tempfile.create('resolv_test_dns_') do |tmpfile| tmpfile.print("\xff\x00\x40") tmpfile.close assert_nothing_raised(ArgumentError, bug9273) do Index: test/resolv/test_addr.rb =================================================================== --- test/resolv/test_addr.rb (revision 46116) +++ test/resolv/test_addr.rb (revision 46117) @@ -17,7 +17,7 @@ class TestResolvAddr < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/resolv/test_addr.rb#L17 def test_invalid_byte_comment bug9273 = '[ruby-core:59239] [Bug #9273]' - Tempfile.open('resolv_test_addr_') do |tmpfile| + Tempfile.create('resolv_test_addr_') do |tmpfile| tmpfile.print("\xff\x00\x40") tmpfile.close hosts = Resolv::Hosts.new(tmpfile.path) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/