aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_uninstall_command.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-18 21:29:41 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-18 21:29:41 +0000
commit95683e5cb2d1ab8351402b09ef853dcdf875bf8d (patch)
tree44500dba22e9aa94ecc5d4fd348512d0fb236501 /test/rubygems/test_gem_commands_uninstall_command.rb
parent81629f05312cc4df2193a17f13c581eda174d9af (diff)
downloadruby-95683e5cb2d1ab8351402b09ef853dcdf875bf8d.tar.gz
* lib/rubygems: Update to RubyGems 2.2.0.preview.1
This brings several new features to RubyGems summarized here: https://github.com/rubygems/rubygems/blob/v2.2.0.preview.1/History.txt * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_uninstall_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_uninstall_command.rb40
1 files changed, 32 insertions, 8 deletions
diff --git a/test/rubygems/test_gem_commands_uninstall_command.rb b/test/rubygems/test_gem_commands_uninstall_command.rb
index 9ba1371b79..ff6e368414 100644
--- a/test/rubygems/test_gem_commands_uninstall_command.rb
+++ b/test/rubygems/test_gem_commands_uninstall_command.rb
@@ -16,18 +16,33 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
@executable = File.join(@gemhome, 'bin', 'executable')
end
- def test_execute_all_gem_names
- @cmd.options[:args] = %w[a b]
+ def test_execute_all_named
+ util_make_gems
+
+ default = new_default_spec 'default', '1'
+ install_default_gems default
+
+ gemhome2 = "#{@gemhome}2"
+
+ a_4 = quick_spec 'a', 4
+ install_gem a_4, :install_dir => gemhome2
+
+ Gem::Specification.dirs = [@gemhome, gemhome2]
+
+ assert_includes Gem::Specification.all_names, 'a-1'
+ assert_includes Gem::Specification.all_names, 'a-4'
+ assert_includes Gem::Specification.all_names, 'b-2'
+ assert_includes Gem::Specification.all_names, 'default-1'
+
@cmd.options[:all] = true
+ @cmd.options[:args] = %w[a]
- assert_raises Gem::MockGemUi::TermError do
- use_ui @ui do
- @cmd.execute
- end
+ use_ui @ui do
+ @cmd.execute
end
- assert_match(/\A(?:WARNING: Unable to use symlinks on Windows, installing wrapper\n)?ERROR: Gem names and --all may not be used together\n\z/,
- @ui.error)
+ assert_equal %w[a-4 a_evil-9 b-2 c-1.2 default-1 dep_x-1 pl-1-x86-linux x-1],
+ Gem::Specification.all_names.sort
end
def test_execute_dependency_order
@@ -217,5 +232,14 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
assert_equal %w[a-4 default-1], Gem::Specification.all_names.sort
end
+ def test_handle_options
+ @cmd.handle_options %w[]
+
+ assert_equal false, @cmd.options[:check_dev]
+ assert_equal nil, @cmd.options[:install_dir]
+ assert_equal true, @cmd.options[:user_install]
+ assert_equal Gem::Requirement.default, @cmd.options[:version]
+ end
+
end