From f086e68bc8fd3b55a61951ffd4119644fbcba48a Mon Sep 17 00:00:00 2001 From: Vyacheslav Alexeev Date: Mon, 13 Jul 2020 08:45:54 +0300 Subject: [PATCH] Clean tmp_paths with mutation of the array --- test/helpers/tmp_path.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/helpers/tmp_path.rb b/test/helpers/tmp_path.rb index 02b129d0..f9fbe741 100644 --- a/test/helpers/tmp_path.rb +++ b/test/helpers/tmp_path.rb @@ -26,8 +26,9 @@ module TmpPath end def clean_tmp_paths - tmp_paths.each { |path| delete_tmp_path(path) } - @tmp_paths = [] + while path = tmp_paths.pop + delete_tmp_path(path) + end end def delete_tmp_path(path)