diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-22 22:46:50 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-22 22:46:50 +0000 |
commit | 4c2304f0004e9f1784540f3d36976aad9eab1f68 (patch) | |
tree | fe5d7f52b7e01644d0a57316aab03299ed0ee5c8 /test/rubygems/test_gem_commands_uninstall_command.rb | |
parent | 66cc0fa4abde68ae360ba2d2cdf4e44bc833e33a (diff) | |
download | ruby-4c2304f0004e9f1784540f3d36976aad9eab1f68.tar.gz |
* lib/rubygems: Import RubyGems from master as of commit b165260
* test/rubygems: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42124 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.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_uninstall_command.rb b/test/rubygems/test_gem_commands_uninstall_command.rb index 844c7b4b97..d6fe3ea5d9 100644 --- a/test/rubygems/test_gem_commands_uninstall_command.rb +++ b/test/rubygems/test_gem_commands_uninstall_command.rb @@ -16,6 +16,20 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase @executable = File.join(@gemhome, 'bin', 'executable') end + def test_execute_all_gem_names + @cmd.options[:args] = %w[a b] + @cmd.options[:all] = true + + assert_raises Gem::MockGemUi::TermError do + use_ui @ui do + @cmd.execute + end + end + + assert_equal "ERROR: Gem names and --all may not be used together\n", + @ui.error + end + def test_execute_dependency_order c = quick_gem 'c' do |spec| spec.add_dependency 'a' @@ -43,6 +57,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase def test_execute_removes_executable ui = Gem::MockGemUi.new + util_setup_gem ui build_rake_in do @@ -175,5 +190,23 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase assert Gem::Specification.find_all_by_name('x').length == 0 end + def test_execute_all + ui = Gem::MockGemUi.new "y\n" + + util_make_gems + util_setup_gem ui + + assert Gem::Specification.find_all_by_name('a').length > 1 + + @cmd.options[:all] = true + @cmd.options[:args] = [] + + use_ui ui do + @cmd.execute + end + + refute_includes Gem::Specification.all_names, 'a' + end + end |