From 13313f9436fb75e3da965a8ce8db9e4b96849111 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 7 May 2026 18:40:15 +0900 Subject: [ruby/rubygems] Assert that override directives never leak into the lockfile Lock the byroot policy decision (overrides are a Gemfile concept and must not be serialized into Gemfile.lock) with a regression test, so a future change that starts emitting override metadata in the lock would fail loudly. https://github.com/ruby/rubygems/commit/9524b785c5 Co-Authored-By: Claude Opus 4.7 (1M context) --- spec/bundler/install/gemfile/override_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/bundler/install/gemfile/override_spec.rb b/spec/bundler/install/gemfile/override_spec.rb index 7a7f8078a8..410bf96737 100644 --- a/spec/bundler/install/gemfile/override_spec.rb +++ b/spec/bundler/install/gemfile/override_spec.rb @@ -129,4 +129,16 @@ RSpec.describe "override DSL" do expect(the_bundle).to include_gems "myrack 1.0.0", "myrack_middleware 1.0" end end + + context "lockfile contents" do + it "does not record the override directive in Gemfile.lock" do + install_gemfile <<-G + source "https://gem.repo1" + override "myrack", version: "= 0.9.1" + gem "myrack" + G + + expect(lockfile).not_to match(/override/i) + end + end end -- cgit v1.2.3