summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rubygems/commands/update_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb
index 052d9f9245..612667dfd0 100644
--- a/lib/rubygems/commands/update_command.rb
+++ b/lib/rubygems/commands/update_command.rb
@@ -264,7 +264,7 @@ command to remove old versions.
def update_rubygems
if Gem.disable_system_update_message
alert_error Gem.disable_system_update_message
- return
+ terminate_interaction 1
end
check_update_arguments
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb
index 3b823a047f..bd06c84107 100644
--- a/test/rubygems/test_gem_commands_update_command.rb
+++ b/test/rubygems/test_gem_commands_update_command.rb
@@ -245,8 +245,10 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
@cmd.options[:args] = []
@cmd.options[:system] = true
- use_ui @ui do
- @cmd.execute
+ assert_raises Gem::MockGemUi::TermError do
+ use_ui @ui do
+ @cmd.execute
+ end
end
assert_empty @ui.output