[前][次][番号順一覧][スレッド一覧]

ruby-changes:43918

From: nobu <ko1@a...>
Date: Tue, 23 Aug 2016 10:34:46 +0900 (JST)
Subject: [ruby-changes:43918] nobu:r55991 (trunk): test_psych.rb: close Tempfile

nobu	2016-08-23 10:34:42 +0900 (Tue, 23 Aug 2016)

  New Revision: 55991

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55991

  Log:
    test_psych.rb: close Tempfile
    
    * test/psych/test_psych.rb (test_load_file_with_fallback): fix
      Tempfile leak.  https://github.com/tenderlove/psych/pull/288

  Modified files:
    trunk/ChangeLog
    trunk/test/psych/test_psych.rb
Index: test/psych/test_psych.rb
===================================================================
--- test/psych/test_psych.rb	(revision 55990)
+++ test/psych/test_psych.rb	(revision 55991)
@@ -145,8 +145,9 @@ class TestPsych < Psych::TestCase https://github.com/ruby/ruby/blob/trunk/test/psych/test_psych.rb#L145
   end
 
   def test_load_file_with_fallback
-    t = Tempfile.create(['empty', 'yml'])
-    assert_equal Hash.new, Psych.load_file(t.path, Hash.new)
+    Tempfile.create(['empty', 'yml']) {|t|
+      assert_equal Hash.new, Psych.load_file(t.path, Hash.new)
+    }
   end
 
   def test_parse_file
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55990)
+++ ChangeLog	(revision 55991)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Aug 23 10:34:40 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* test/psych/test_psych.rb (test_load_file_with_fallback): fix
+	  Tempfile leak.  https://github.com/tenderlove/psych/pull/288
+
 Tue Aug 23 10:15:01 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* string.c (rb_fs_setter): check and convert $; value at

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]