diff options
author | Brian Le <[email protected]> | 2022-06-30 16:20:53 -0700 |
---|---|---|
committer | git <[email protected]> | 2022-07-06 02:59:14 +0900 |
commit | 902d1a5c513ed6e49e7f577ffe7146d30798b3e9 (patch) | |
tree | 56848808c47646f70ff5ffc191ed2c897c1ec84d | |
parent | 6eab8095fa13ba6137f3807ed04188a53d587875 (diff) |
[rubygems/rubygems] add message when gems are requested to be updated but they are not installed
https://github.com/rubygems/rubygems/commit/27953ffe9a
-rw-r--r-- | lib/rubygems/commands/update_command.rb | 1 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_update_command.rb | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb index 59e020fd63..04ce0ea935 100644 --- a/lib/rubygems/commands/update_command.rb +++ b/lib/rubygems/commands/update_command.rb @@ -130,6 +130,7 @@ command to remove old versions. say "Gems updated: #{updated_names.join(' ')}" end say "Gems already up-to-date: #{up_to_date_names.join(' ')}" unless up_to_date_names.empty? + say "Gems not currently installed: #{not_installed_names.join(' ')}" unless not_installed_names.empty? end def fetch_remote_gems(spec) # :nodoc: diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb index acb60a7583..1d8dcb2e64 100644 --- a/test/rubygems/test_gem_commands_update_command.rb +++ b/test/rubygems/test_gem_commands_update_command.rb @@ -812,4 +812,24 @@ class TestGemCommandsUpdateCommand < Gem::TestCase assert_equal " a-2", out.shift assert_empty out end + + def test_execute_named_not_installed_and_no_update + spec_fetcher do |fetcher| + fetcher.spec 'a', 2 + end + + @cmd.options[:args] = %w[a b] + + use_ui @ui do + @cmd.execute + end + + out = @ui.output.split "\n" + assert_equal "Updating installed gems", out.shift + assert_equal "Nothing to update", out.shift + assert_equal "Gems already up-to-date: a", out.shift + assert_equal "Gems not currently installed: b", out.shift + + assert_empty out + end end |