[rubygems/rubygems] Add 'call for update' to RubyGems install command.

05811f8248
This commit is contained in:
Josef Šimánek 2022-09-11 05:40:55 +02:00 committed by Hiroshi SHIBATA
parent ceeefb5870
commit c7d043065c
Notes: git 2022-11-11 08:24:29 +00:00
6 changed files with 243 additions and 0 deletions

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true
require_relative "helper"
require_relative "test_gem_update_suggestion"
require "rubygems/commands/install_command"
require "rubygems/request_set"
require "rubygems/rdoc"
@ -1550,4 +1551,22 @@ ERROR: Possible alternatives: non_existent_with_hint
assert_equal " a-3", out.shift
assert_empty out
end
def test_suggest_update_if_enabled
TestUpdateSuggestion.with_eglible_environment(cmd: @cmd) do
spec_fetcher do |fetcher|
fetcher.gem "a", 2
end
@cmd.options[:args] = %w[a]
use_ui @ui do
assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
end
assert_includes @ui.output, "A new release of RubyGems is available: 1.2.3 → 2.0.0!"
end
end
end