ruby-changes:50887
From: mame <ko1@a...>
Date: Thu, 5 Apr 2018 00:26:17 +0900 (JST)
Subject: [ruby-changes:50887] mame:r63094 (trunk): test/test_tempfile.rb: close a file object created by Tempfile.create
mame 2018-04-05 00:26:11 +0900 (Thu, 05 Apr 2018) New Revision: 63094 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63094 Log: test/test_tempfile.rb: close a file object created by Tempfile.create To stop a "Leaked file descriptor" warning. Modified files: trunk/test/test_tempfile.rb Index: test/test_tempfile.rb =================================================================== --- test/test_tempfile.rb (revision 63093) +++ test/test_tempfile.rb (revision 63094) @@ -396,8 +396,10 @@ puts Tempfile.new('foo').path https://github.com/ruby/ruby/blob/trunk/test/test_tempfile.rb#L396 def test_create_traversal_dir expect = Dir.glob(TRAVERSAL_PATH + '*').count - Tempfile.create(TRAVERSAL_PATH + 'foo') + t = Tempfile.create(TRAVERSAL_PATH + 'foo') actual = Dir.glob(TRAVERSAL_PATH + '*').count assert_equal expect, actual + ensure + t.close end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/