From 1fa48314b10de6d2c9f031daea8fc82e6216d3ca Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 1 May 2026 12:47:07 +0900 Subject: [ruby/rubygems] Add version: nil integration coverage Verify end-to-end that override(..., version: nil) collapses the requirement to Gem::Requirement.default for both direct deps (a Gemfile pin to 0.9.1 is removed) and transitive deps (a myrack_middleware-imposed = 0.9.1 floor is removed). https://github.com/ruby/rubygems/commit/7df463f5c7 Co-Authored-By: Claude Opus 4.7 (1M context) --- spec/bundler/install/gemfile/override_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spec/bundler/install/gemfile/override_spec.rb b/spec/bundler/install/gemfile/override_spec.rb index 0b5f868d42..8a00186d60 100644 --- a/spec/bundler/install/gemfile/override_spec.rb +++ b/spec/bundler/install/gemfile/override_spec.rb @@ -88,4 +88,26 @@ RSpec.describe "override DSL" do expect(the_bundle).to include_gems "myrack 1.0.0" end end + + context "with a version: nil operation" do + it "drops a direct dependency's pin entirely" do + install_gemfile <<-G + source "https://gem.repo1" + override "myrack", version: nil + gem "myrack", "= 0.9.1" + G + + expect(the_bundle).to include_gems "myrack 1.0.0" + end + + it "drops a transitive dependency's pin entirely" do + install_gemfile <<-G + source "https://gem.repo1" + override "myrack", version: nil + gem "myrack_middleware" + G + + expect(the_bundle).to include_gems "myrack 1.0.0", "myrack_middleware 1.0" + end + end end -- cgit v1.2.3