summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_commands_cleanup_command.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-05 01:00:01 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-05 01:00:01 +0000
commit3434676e9e3c87c39fe4a8c411a041449efc7446 (patch)
tree1dabd9705561ef803bb9f62e6d8e3eaf0618a1cb /test/rubygems/test_gem_commands_cleanup_command.rb
parentd24997cce12d27cec767ca7091a076df1b2319db (diff)
* lib/rubygems: Import RubyGems 1.8.7:
Added missing require for `gem uninstall --format-executable`. The correct name of the executable being uninstalled is now displayed with --format-executable. Fixed `gem unpack uninstalled_gem` default version picker. RubyGems no longer claims a nonexistent gem can be uninstalled. `gem which` no longer claims directories are requirable files. `gem cleanup` continues cleaning up gems if one can't be uninstalled due to permissions. Issue #82. Gem repository directories are no longer created world-writable. Patch by Sakuro OZAWA. [Ruby 1.9 - Bug #4930] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_cleanup_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_cleanup_command.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_cleanup_command.rb b/test/rubygems/test_gem_commands_cleanup_command.rb
index 22bbfb7a2f..40c7b30539 100644
--- a/test/rubygems/test_gem_commands_cleanup_command.rb
+++ b/test/rubygems/test_gem_commands_cleanup_command.rb
@@ -38,6 +38,44 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
refute_path_exists @b_1.gem_dir
end
+ def test_execute_all_user
+ @a_1_1 = quick_spec 'a', '1.1'
+ @a_1_1 = install_gem_user @a_1_1 # pick up user install path
+
+ Gem::Specification.dirs = [Gem.dir, Gem.user_dir]
+
+ assert_path_exists @a_1.gem_dir
+ assert_path_exists @a_1_1.gem_dir
+
+ @cmd.options[:args] = %w[a]
+
+ @cmd.execute
+
+ refute_path_exists @a_1.gem_dir
+ refute_path_exists @a_1_1.gem_dir
+ end
+
+ def test_execute_all_user_no_sudo
+ FileUtils.chmod 0555, @gemhome
+
+ @a_1_1 = quick_spec 'a', '1.1'
+ @a_1_1 = install_gem_user @a_1_1 # pick up user install path
+
+ Gem::Specification.dirs = [Gem.dir, Gem.user_dir]
+
+ assert_path_exists @a_1.gem_dir
+ assert_path_exists @a_1_1.gem_dir
+
+ @cmd.options[:args] = %w[a]
+
+ @cmd.execute
+
+ assert_path_exists @a_1.gem_dir
+ refute_path_exists @a_1_1.gem_dir
+ ensure
+ FileUtils.chmod 0755, @gemhome
+ end unless win_platform?
+
def test_execute_dry_run
@cmd.options[:args] = %w[a]
@cmd.options[:dryrun] = true