[rubygems/rubygems] Look in configured path when checking if self-update version is installed

https://github.com/rubygems/rubygems/commit/1ce0882e6f
This commit is contained in:
David Rodríguez 2025-06-03 12:56:55 +02:00 committed by Hiroshi SHIBATA
parent 1befc5d102
commit 5cf07c1e8f
2 changed files with 5 additions and 3 deletions

View File

@ -142,6 +142,7 @@ module Bundler
end
def find_latest_matching_spec(requirement)
Bundler.configure
local_result = find_latest_matching_spec_from_collection(local_specs, requirement)
return local_result if local_result && requirement.specific?

View File

@ -1685,7 +1685,7 @@ RSpec.describe "bundle update --bundler" do
end
it "allows updating to development versions if already installed locally" do
system_gems "bundler-9.0.0.dev"
system_gems "bundler-9.9.9"
build_repo4 do
build_gem "myrack", "1.0"
@ -1696,6 +1696,7 @@ RSpec.describe "bundle update --bundler" do
gem "myrack"
G
system_gems "bundler-9.0.0.dev", path: local_gem_path
bundle :update, bundler: "9.0.0.dev", verbose: "true"
checksums = checksums_section_when_enabled do |c|
@ -1722,7 +1723,7 @@ RSpec.describe "bundle update --bundler" do
end
it "does not touch the network if not necessary" do
system_gems "bundler-9.9.9", "bundler-9.0.0"
system_gems "bundler-9.9.9"
build_repo4 do
build_gem "myrack", "1.0"
@ -1732,7 +1733,7 @@ RSpec.describe "bundle update --bundler" do
source "https://gem.repo4"
gem "myrack"
G
system_gems "bundler-9.0.0", path: local_gem_path
bundle :update, bundler: "9.0.0", verbose: true
expect(out).not_to include("Fetching gem metadata from https://rubygems.org/")