summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lib/minitest/unit.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/lib/minitest/unit.rb b/test/lib/minitest/unit.rb
index c51baf7cf8..7fdbc4b291 100644
--- a/test/lib/minitest/unit.rb
+++ b/test/lib/minitest/unit.rb
@@ -130,11 +130,16 @@ 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
@@ -155,6 +160,9 @@ module MiniTest
end
result
+ ensure
+ tempfile_a.close! if tempfile_a
+ tempfile_b.close! if tempfile_b
end
##