Skip to content

Commit a40b224

Browse files
hsbtclaude
andcommitted
Cover prerelease pin via override
When the Gemfile dependency does not request a prerelease, Resolver::Package's prerelease policy normally filters them out. Because Definition#expanded_dependencies now feeds the effective (override-applied) dep into Resolver::Base, an override that pins an exact prerelease propagates into the package's prerelease decision and the prerelease becomes selectable. Lock that contract in with an integration test on a has_prerelease 1.0 / 1.1.pre fixture. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 248e1ba commit a40b224

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

spec/install/gemfile/override_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,20 @@
5050

5151
expect(the_bundle).to include_gems "myrack 0.9.1"
5252
end
53+
54+
it "pins a prerelease version that the Gemfile dependency would otherwise filter out" do
55+
build_repo2 do
56+
build_gem "has_prerelease", "1.0"
57+
build_gem "has_prerelease", "1.1.pre"
58+
end
59+
60+
install_gemfile <<-G
61+
source "https://gem.repo2"
62+
override "has_prerelease", version: "= 1.1.pre"
63+
gem "has_prerelease"
64+
G
65+
66+
expect(the_bundle).to include_gems "has_prerelease 1.1.pre"
67+
end
5368
end
5469
end

0 commit comments

Comments
 (0)