diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-30 13:01:35 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-30 13:01:35 +0000 |
commit | 8da8d4b043c37b53a69803c71ff36b478d4776d0 (patch) | |
tree | 7c8cec15645e74f19c88e4eb5b210b96174c7d03 /test/rubygems/test_gem_commands_uninstall_command.rb | |
parent | c5cb386eba6d9a2d9a8e6ffa8c30137d0c4660c1 (diff) |
Merge RubyGems 3.0.0.beta1.
* It drop to support < Ruby 2.2
* Cleanup deprecated methods and classes.
* Mark obsoleted methods to deprecate.
* and other enhancements.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63528 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 | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/test/rubygems/test_gem_commands_uninstall_command.rb b/test/rubygems/test_gem_commands_uninstall_command.rb index 2fdff706e7..f23f4c2461 100644 --- a/test/rubygems/test_gem_commands_uninstall_command.rb +++ b/test/rubygems/test_gem_commands_uninstall_command.rb @@ -238,7 +238,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase @cmd.handle_options %w[] assert_equal false, @cmd.options[:check_dev] - assert_equal nil, @cmd.options[:install_dir] + assert_nil @cmd.options[:install_dir] assert_equal true, @cmd.options[:user_install] assert_equal Gem::Requirement.default, @cmd.options[:version] assert_equal false, @cmd.options[:vendor] @@ -291,5 +291,31 @@ WARNING: Use your OS package manager to uninstall vendor gems assert_equal output.first, "Gem 'd' is not installed" end + def test_execute_with_gem_uninstall_error + util_make_gems + + @cmd.options[:args] = %w[a] + + uninstall_exception = lambda do |_a| + ex = Gem::UninstallError.new + ex.spec = @spec + + raise ex + end + + e = nil + @cmd.stub :uninstall, uninstall_exception do + use_ui @ui do + e = assert_raises Gem::MockGemUi::TermError do + @cmd.execute + end + end + + assert_equal 1, e.exit_code + end + + assert_empty @ui.output + assert_match %r!Error: unable to successfully uninstall '#{@spec.name}'!, @ui.error + end end |