From 91fc0a91037c08d56a43e852318982c9035e1c99 Mon Sep 17 00:00:00 2001 From: kazu Date: Mon, 11 Jun 2018 14:13:56 +0000 Subject: [PATCH] Use `&.` instead of modifier if and remove needless closed? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/test_tempfile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb index 988dcf3a23..8c49498d18 100644 --- a/test/test_tempfile.rb +++ b/test/test_tempfile.rb @@ -361,7 +361,7 @@ puts Tempfile.new('foo').path f.close assert_file.exist?(path) ensure - f.close if f && !f.closed? + f&.close File.unlink path if path end