summaryrefslogtreecommitdiff
path: root/test/rubygems/helper.rb
diff options
context:
space:
mode:
authorTomas Volf <tomas.volf@showmax.com>2022-06-24 09:21:47 +0200
committergit <svn-admin@ruby-lang.org>2022-06-26 11:15:43 +0900
commit56809537a46417d4c0f93de9ea9fc9a623ea83f1 (patch)
tree23332bc22898a2284231074f4d44b85af24bef23 /test/rubygems/helper.rb
parentf159bbd17da88a7f456e0ec7fbf7890135d456a3 (diff)
[rubygems/rubygems] Clean up temporary directory after generate_index --update
While generate_index did clean up temporary directory, when running with --update flag, that did not happen and the temporary directory was left behind. This commit fixes that and modifies tests in order to make sure this is not reintroduced later on. Fixes #5635. https://github.com/rubygems/rubygems/commit/9fa34dc329
Diffstat (limited to 'test/rubygems/helper.rb')
-rw-r--r--test/rubygems/helper.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb
index 75eed7be6b..7bd7dd0c3b 100644
--- a/test/rubygems/helper.rb
+++ b/test/rubygems/helper.rb
@@ -119,6 +119,12 @@ class Gem::TestCase < Test::Unit::TestCase
assert File.directory?(path), msg
end
+ def refute_directory_exists(path, msg = nil)
+ msg = build_message(msg, "Expected path '#{path}' not to be a directory")
+ assert_path_not_exist path
+ refute File.directory?(path), msg
+ end
+
# https://github.com/seattlerb/minitest/blob/21d9e804b63c619f602f3f4ece6c71b48974707a/lib/minitest/assertions.rb#L188
def _synchronize
yield