Revert "[rubygems/rubygems] Fix require of a default gem when unresolved gems depend on it"

This reverts commit f1f5f22d22a149f20e019728b1ab35593d29d81a.
This commit is contained in:
Hiroshi SHIBATA 2024-01-19 12:12:33 +09:00
parent 04cf66765a
commit 54552b89e7
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2
2 changed files with 0 additions and 22 deletions

View File

@ -62,8 +62,6 @@ module Kernel
Kernel.send(:gem, spec.name, Gem::Requirement.default_prerelease) unless
resolved_path
next
end
# If there are no unresolved deps, then we can use just try

View File

@ -540,26 +540,6 @@ class TestGemRequire < Gem::TestCase
assert_equal %w[default-3.0.0.rc2], loaded_spec_names
end
def test_default_gem_with_unresolved_gems_depending_on_it
net_http_old = util_spec "net-http", "0.1.1", nil, "lib/net/http.rb"
install_gem net_http_old
net_http_default = new_default_spec "net-http", "0.3.0", nil, "net/http.rb"
install_default_gems net_http_default
faraday_1 = util_spec "faraday", "1", { "net-http" => ">= 0" }
install_gem faraday_1
faraday_2 = util_spec "faraday", "2", { "net-http" => ">= 0" }
install_gem faraday_2
chef = util_spec "chef", "1", { "faraday" => [">= 1", "< 3"] }, "lib/chef.rb"
install_gem chef
assert_require "chef"
assert_require "net/http"
end
def loaded_spec_names
Gem.loaded_specs.values.map(&:full_name).sort
end