aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_update_command.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-04-15 12:47:18 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-04-15 15:36:15 +0900
commit96741765d880b700933526a97a67345dfcd90c47 (patch)
tree565766c43e97b7deb93f2390af955465a85ee668 /test/rubygems/test_gem_commands_update_command.rb
parented149dbf46d1a8b16e6de9c3dbbcc10f72c9c019 (diff)
downloadruby-96741765d880b700933526a97a67345dfcd90c47.tar.gz
Merge the master branch of RubyGems
Diffstat (limited to 'test/rubygems/test_gem_commands_update_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb29
1 files changed, 28 insertions, 1 deletions
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb
index 13cc10c298..9b590f0022 100644
--- a/test/rubygems/test_gem_commands_update_command.rb
+++ b/test/rubygems/test_gem_commands_update_command.rb
@@ -168,6 +168,15 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
@cmd.options[:args] = []
@cmd.options[:system] = "2.5.1"
+ oldest_version_mod = Module.new do
+ def oldest_supported_version
+ Gem::Version.new("2.5.2")
+ end
+ private :oldest_supported_version
+ end
+
+ @cmd.extend(oldest_version_mod)
+
assert_raises Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.execute
@@ -175,7 +184,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
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
+ assert_equal "ERROR: rubygems 2.5.1 is not supported on #{RUBY_VERSION}. The oldest version supported by this ruby is 2.5.2\n", @ui.error
end
def test_execute_system_specific_older_than_3_2_removes_plugins_dir
@@ -185,6 +194,15 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
end
end
+ oldest_version_mod = Module.new do
+ def oldest_supported_version
+ Gem::Version.new("2.5.2")
+ end
+ private :oldest_supported_version
+ end
+
+ @cmd.extend(oldest_version_mod)
+
@cmd.options[:args] = []
@cmd.options[:system] = "3.1"
@@ -203,6 +221,15 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
end
end
+ oldest_version_mod = Module.new do
+ def oldest_supported_version
+ Gem::Version.new("2.5.2")
+ end
+ private :oldest_supported_version
+ end
+
+ @cmd.extend(oldest_version_mod)
+
@cmd.options[:args] = []
@cmd.options[:system] = "3.2.a"