summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-07-13 14:37:17 +0900
committernagachika <nagachika@ruby-lang.org>2022-09-03 15:54:07 +0900
commitb9f6a09bd2127ea51612bd27bef5830831b48d4f (patch)
tree2ea33c0d2c14e86b1b0ad7449d85ec068d954aea /test
parentd7862a5de43f7412ab41cdae6709c8a30b988621 (diff)
Merge RubyGems-3.3.15 and Bundler-2.3.15
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/data/null-type.gemspec.rzbin504 -> 433 bytes
-rw-r--r--test/rubygems/test_gem_command_manager.rb8
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb31
-rw-r--r--test/rubygems/test_gem_specification.rb2
4 files changed, 39 insertions, 2 deletions
diff --git a/test/rubygems/data/null-type.gemspec.rz b/test/rubygems/data/null-type.gemspec.rz
index 2134fcde29..58fc1ed8a0 100644
--- a/test/rubygems/data/null-type.gemspec.rz
+++ b/test/rubygems/data/null-type.gemspec.rz
Binary files differ
diff --git a/test/rubygems/test_gem_command_manager.rb b/test/rubygems/test_gem_command_manager.rb
index bee635d67e..00197d10f7 100644
--- a/test/rubygems/test_gem_command_manager.rb
+++ b/test/rubygems/test_gem_command_manager.rb
@@ -80,7 +80,13 @@ class TestGemCommandManager < Gem::TestCase
message << "\nDid you mean? \"push\""
end
- assert_equal message, e.message
+ if e.respond_to?(:detailed_message)
+ actual_message = e.detailed_message(highlight: false).sub(/\A(.*?)(?: \(.+?\))/) { $1 }
+ else
+ actual_message = e.message
+ end
+
+ assert_equal message, actual_message
end
def test_run_interrupt
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb
index c765e9a8df..b5e9f004d1 100644
--- a/test/rubygems/test_gem_commands_update_command.rb
+++ b/test/rubygems/test_gem_commands_update_command.rb
@@ -191,6 +191,37 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
assert_empty out
end
+ def test_execute_system_update_installed_in_non_default_gem_path
+ rubygems_update_spec = quick_gem "rubygems-update", 9 do |s|
+ write_file File.join(@tempdir, 'setup.rb')
+
+ s.files += %w[setup.rb]
+ end
+
+ util_setup_spec_fetcher rubygems_update_spec
+
+ rubygems_update_package = Gem::Package.build rubygems_update_spec
+
+ gemhome2 = "#{@gemhome}2"
+
+ Gem::Installer.at(rubygems_update_package, :install_dir => gemhome2).install
+
+ Gem.use_paths @gemhome, [gemhome2, @gemhome]
+
+ @cmd.options[:args] = []
+ @cmd.options[:system] = true
+
+ use_ui @ui do
+ @cmd.execute
+ end
+
+ out = @ui.output.split "\n"
+ assert_equal "Installing RubyGems 9", out.shift
+ assert_equal "RubyGems system software updated", out.shift
+
+ assert_empty out
+ end
+
def test_execute_system_specific
spec_fetcher do |fetcher|
fetcher.download 'rubygems-update', 8 do |s|
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index 8b0477c4dd..ccb81caf37 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -1072,7 +1072,7 @@ dependencies: []
data = Marshal.load Gem::Util.inflate(Gem.read_binary(path))
- assert_nil data.signing_key
+ assert_instance_of Gem::Specification, data
end
def test_initialize