Skip to content

Commit b21f6c3

Browse files
committed
Delete tempfile so files at this path are not deleted during tests
Signed-off-by: Brandon Fish <brandon.j.fish@oracle.com>
1 parent 735b083 commit b21f6c3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/units/test_archive.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ class TestArchive < Test::Unit::TestCase
77
def setup
88
set_file_paths
99
@git = Git.open(@wdir)
10+
@tempfiles = []
11+
end
12+
13+
def teardown
14+
@tempfiles.clear
1015
end
1116

1217
def tempfile
1318
tempfile_object = Tempfile.new('archive-test')
19+
@tempfiles << tempfile_object # prevent deletion until teardown
1420
tempfile_object.close # close to avoid locking from git processes
1521
tempfile_object.path
1622
end

0 commit comments

Comments
 (0)