summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2026-05-01 12:47:07 +0900
committergit <svn-admin@ruby-lang.org>2026-05-07 09:24:55 +0000
commit1fa48314b10de6d2c9f031daea8fc82e6216d3ca (patch)
tree5f705ebcc04b5893f66a867e92b32b0fe6acb912
parentb5f31bbd19a1a3130d441479d5c12700b285f0b0 (diff)
[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) <noreply@anthropic.com>
-rw-r--r--spec/bundler/install/gemfile/override_spec.rb22
1 files changed, 22 insertions, 0 deletions
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