From e8c3872555fc85640505974e6b1c39d315572689 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 29 Aug 2020 12:17:07 +0200 Subject: Simplify Tempfile.open calls with a block as they now unlink the file automatically --- test/rdoc/test_rdoc_parser.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'test/rdoc/test_rdoc_parser.rb') diff --git a/test/rdoc/test_rdoc_parser.rb b/test/rdoc/test_rdoc_parser.rb index 7cc3c2d926..cd43aca121 100644 --- a/test/rdoc/test_rdoc_parser.rb +++ b/test/rdoc/test_rdoc_parser.rb @@ -106,7 +106,7 @@ class TestRDocParser < RDoc::TestCase def test_class_for_forbidden omit 'chmod not supported' if Gem.win_platform? - tf = Tempfile.open 'forbidden' do |io| + Tempfile.open 'forbidden' do |io| begin File.chmod 0000, io.path forbidden = @store.add_file io.path @@ -117,9 +117,7 @@ class TestRDocParser < RDoc::TestCase ensure File.chmod 0400, io.path end - io end - tf.close! end def test_class_for_modeline -- cgit v1.2.3