From b29d00c81d3362c286c5388201e3fee8db245050 Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Wed, 5 Jan 2022 15:11:14 -0600 Subject: [PATCH] Store tempfile objects to prevent deletion during tests Signed-off-by: Brandon Fish --- tests/units/test_archive.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/units/test_archive.rb b/tests/units/test_archive.rb index 3386a27f..93ec66f2 100644 --- a/tests/units/test_archive.rb +++ b/tests/units/test_archive.rb @@ -7,10 +7,16 @@ class TestArchive < Test::Unit::TestCase def setup set_file_paths @git = Git.open(@wdir) + @tempfiles = [] + end + + def teardown + @tempfiles.clear end def tempfile tempfile_object = Tempfile.new('archive-test') + @tempfiles << tempfile_object # prevent deletion until teardown tempfile_object.close # close to avoid locking from git processes tempfile_object.path end pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy