mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Avoid tempfile leaks using Tempfile.create instead of Tempfile.open.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
62fc67b27b
commit
198964ea2f
2 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ class TestResolvAddr < Test::Unit::TestCase
|
|||
|
||||
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)
|
||||
|
|
|
@ -153,7 +153,7 @@ class TestResolvDNS < Test::Unit::TestCase
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue