Disallow downgrades to too old versions

Consider the version original included with each ruby as the minimum
supported version.
This commit is contained in:
David Rodríguez 2020-04-28 16:28:52 +02:00 committed by Hiroshi SHIBATA
parent 828cefd629
commit c6bdf75049
Notes: git 2020-09-28 14:54:56 +09:00
2 changed files with 36 additions and 1 deletions

View file

@ -158,6 +158,26 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
assert_empty out
end
def test_execute_system_specific_older_than_minimum_supported_rubygems
spec_fetcher do |fetcher|
fetcher.download 'rubygems-update', "2.5.1" do |s|
s.files = %w[setup.rb]
end
end
@cmd.options[:args] = []
@cmd.options[:system] = "2.5.1"
assert_raises Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
end
end
assert_empty @ui.output
assert_equal "ERROR: rubygems 2.5.1 is not supported. The oldest supported version is 2.5.2\n", @ui.error
end
def test_execute_system_specific_older_than_3_2_removes_plugins_dir
spec_fetcher do |fetcher|
fetcher.download 'rubygems-update', 3.1 do |s|