summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-08-29 12:17:07 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-08-29 12:23:23 +0200
commite8c3872555fc85640505974e6b1c39d315572689 (patch)
treed3efaa93985db2932c57d15729d18e3c0e1ca2d6 /tool
parentff323b2a5c56cdec93900af4d67f3811f946d9b8 (diff)
Simplify Tempfile.open calls with a block as they now unlink the file automatically
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/minitest/unit.rb8
1 files changed, 0 insertions, 8 deletions
diff --git a/tool/lib/minitest/unit.rb b/tool/lib/minitest/unit.rb
index c325134e63..9066782322 100644
--- a/tool/lib/minitest/unit.rb
+++ b/tool/lib/minitest/unit.rb
@@ -122,16 +122,11 @@ module MiniTest
return "Expected: #{mu_pp exp}\n Actual: #{mu_pp act}" unless
need_to_diff
- tempfile_a = nil
- tempfile_b = nil
-
Tempfile.open("expect") do |a|
- tempfile_a = a
a.puts expect
a.flush
Tempfile.open("butwas") do |b|
- tempfile_b = b
b.puts butwas
b.flush
@@ -152,9 +147,6 @@ module MiniTest
end
result
- ensure
- tempfile_a.close! if tempfile_a
- tempfile_b.close! if tempfile_b
end
##