Skip to content

Commit

Permalink
Exit with non-zero status on disabled gem system update.
Browse files Browse the repository at this point in the history
  • Loading branch information
simi authored and hsbt committed Jun 15, 2020
1 parent 3ab1cfc commit 7a57110
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rubygems/commands/update_command.rb
Expand Up @@ -264,7 +264,7 @@ def update_gems(gems_to_update)
def update_rubygems
if Gem.disable_system_update_message
alert_error Gem.disable_system_update_message
return
terminate_interaction 1
end

check_update_arguments
Expand Down
6 changes: 4 additions & 2 deletions test/rubygems/test_gem_commands_update_command.rb
Expand Up @@ -245,8 +245,10 @@ def test_execute_system_with_disabled_update
@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
Expand Down

0 comments on commit 7a57110

Please sign in to comment.