Skip to content

Commit 0e70cba

Browse files
committed
Add teardown method to TestCase
1 parent 1e9820a commit 0e70cba

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

test/test_helper.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
require 'ro_crate'
66
require 'webmock/test_unit'
77

8-
def teardown
9-
self._opened_files.each(&:close)
10-
end
8+
class Test::Unit::TestCase
9+
def teardown
10+
self._opened_files.each do |f|
11+
f.close unless f.closed?
12+
end
13+
end
1114

12-
def _opened_files
13-
@opened_files ||= []
15+
def _opened_files
16+
@opened_files ||= []
17+
end
1418
end
1519

1620
def fixture_file(name, *args)

0 commit comments

Comments
 (0)