diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-27 03:42:40 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-27 03:42:40 +0000 |
commit | 76325a8be6e1cef9fe8d2abb403fa4bb2b880ab3 (patch) | |
tree | b9ad19765cdf7a5a8b4026ebf6e101e3aefb4889 /test/rubygems | |
parent | 284144838c798d87ee2d5b30da6c17f764753091 (diff) |
* lib/rubygems/uninstaller.rb: Add missing require and update
messaging to avoid confusion with uninstall --format-executable.
[Ruby 1.9 - Bug #4062]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems')
-rw-r--r-- | test/rubygems/test_gem_commands_uninstall_command.rb | 13 | ||||
-rw-r--r-- | test/rubygems/test_gem_uninstaller.rb | 12 |
2 files changed, 11 insertions, 14 deletions
diff --git a/test/rubygems/test_gem_commands_uninstall_command.rb b/test/rubygems/test_gem_commands_uninstall_command.rb index a2c11b7216..132c370f11 100644 --- a/test/rubygems/test_gem_commands_uninstall_command.rb +++ b/test/rubygems/test_gem_commands_uninstall_command.rb @@ -69,19 +69,6 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase Gem::Installer.exec_format = nil end - def test_execute_not_installed - @cmd.options[:args] = ["foo"] - e = assert_raises Gem::InstallError do - use_ui @ui do - @cmd.execute - end - end - - assert_match(/\Acannot uninstall, check `gem list -d foo`$/, e.message) - output = @ui.output.split "\n" - assert_empty output, "UI output should be empty after an uninstall error" - end - def test_execute_prerelease @spec = quick_spec "pre", "2.b" @gem = File.join @tempdir, @spec.file_name diff --git a/test/rubygems/test_gem_uninstaller.rb b/test/rubygems/test_gem_uninstaller.rb index a94fc43ff9..aecc4e3807 100644 --- a/test/rubygems/test_gem_uninstaller.rb +++ b/test/rubygems/test_gem_uninstaller.rb @@ -94,7 +94,7 @@ class TestGemUninstaller < Gem::InstallerTestCase exec_path = File.join Gem.user_dir, 'bin', 'foo-executable-bar' assert_equal false, File.exist?(exec_path), 'removed exec from bin dir' - assert_equal "Removing executable\n", @ui.output + assert_equal "Removing foo-executable-bar\n", @ui.output ensure Gem::Installer.exec_format = nil end @@ -158,6 +158,16 @@ class TestGemUninstaller < Gem::InstallerTestCase assert_same uninstaller, @post_uninstall_hook_arg end + def test_uninstall_nonexistent + uninstaller = Gem::Uninstaller.new 'bogus', :executables => true + + e = assert_raises Gem::InstallError do + uninstaller.uninstall + end + + assert_equal 'gem "bogus" is not installed', e.message + end + def test_uninstall_not_ok quick_gem 'z' do |s| s.add_runtime_dependency @spec.name |