mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/lib/minitest/unit.rb (MiniTest::Assertions#diff): Remove
tempfiles. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
198964ea2f
commit
8559c4c125
2 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun May 25 23:02:06 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* test/lib/minitest/unit.rb (MiniTest::Assertions#diff): Remove
|
||||
tempfiles.
|
||||
|
||||
Sun May 25 22:42:27 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* test/lib/minitest/unit.rb: Check tempfile leak for each test class.
|
||||
|
|
|
@ -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
|
||||
|
||||
##
|
||||
|
|
Loading…
Add table
Reference in a new issue