[rubygems/rubygems] output gems already up-to-date regardless if any gems were updated

https://github.com/rubygems/rubygems/commit/4ec608a573
This commit is contained in:
Brian Le 2022-06-30 16:20:02 -07:00 committed by git
parent f681f9ae24
commit 6eab8095fa
2 changed files with 5 additions and 1 deletions

View File

@ -118,15 +118,18 @@ command to remove old versions.
updated = update_gems gems_to_update
installed_names = highest_installed_gems.keys
updated_names = updated.map {|spec| spec.name }
not_updated_names = options[:args].uniq - updated_names
not_installed_names = not_updated_names - installed_names
up_to_date_names = not_updated_names - not_installed_names
if updated.empty?
say "Nothing to update"
else
say "Gems updated: #{updated_names.join(' ')}"
say "Gems already up-to-date: #{not_updated_names.join(' ')}" unless not_updated_names.empty?
end
say "Gems already up-to-date: #{up_to_date_names.join(' ')}" unless up_to_date_names.empty?
end
def fetch_remote_gems(spec) # :nodoc:

View File

@ -535,6 +535,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
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_empty out
end