diff options
author | David RodrÃguez <[email protected]> | 2020-04-28 16:28:52 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2020-09-28 14:54:22 +0900 |
commit | c6bdf750499491d12c947de546c164a854dd0703 (patch) | |
tree | a6dcad2cb1e96f21b80946dcda6e393a73d34bec /test/rubygems/test_gem_commands_update_command.rb | |
parent | 828cefd629e036c96fbd50013965f61df39417ce (diff) |
Disallow downgrades to too old versions
Consider the version original included with each ruby as the minimum
supported version.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3599
Diffstat (limited to 'test/rubygems/test_gem_commands_update_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_update_command.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb index 65a70b2b74..eed799c5aa 100644 --- a/test/rubygems/test_gem_commands_update_command.rb +++ b/test/rubygems/test_gem_commands_update_command.rb @@ -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| |