aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_cleanup_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_commands_cleanup_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_cleanup_command.rb30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/rubygems/test_gem_commands_cleanup_command.rb b/test/rubygems/test_gem_commands_cleanup_command.rb
index f988f81e55..8354160dbf 100644
--- a/test/rubygems/test_gem_commands_cleanup_command.rb
+++ b/test/rubygems/test_gem_commands_cleanup_command.rb
@@ -112,7 +112,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
@cmd.execute
assert_path_exists @a_1.gem_dir
- refute_path_exists @a_1_1.gem_dir
+ assert_path_exists @a_1_1.gem_dir
ensure
FileUtils.chmod 0755, @gemhome
end unless win_platform?
@@ -165,5 +165,33 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
assert_match %r%^Skipped default gems: b-2%, @ui.output
assert_empty @ui.error
end
+
+ def test_execute_remove_gem_home_only
+ c_1, = util_gem 'c', '1'
+ c_2, = util_gem 'c', '2'
+ d_1, = util_gem 'd', '1'
+ d_2, = util_gem 'd', '2'
+ e_1, = util_gem 'e', '1'
+ e_2, = util_gem 'e', '2'
+
+ c_1 = install_gem c_1, :user_install => true # pick up user install path
+ c_2 = install_gem c_2
+
+ d_1 = install_gem d_1
+ d_2 = install_gem d_2, :user_install => true # pick up user install path
+
+ e_1 = install_gem e_1
+ e_2 = install_gem e_2
+
+ Gem::Specification.dirs = [Gem.dir, Gem.user_dir]
+
+ @cmd.options[:args] = []
+
+ @cmd.execute
+
+ assert_path_exists c_1.gem_dir
+ refute_path_exists d_1.gem_dir
+ refute_path_exists e_1.gem_dir
+ end
end