diff options
author | Martin Emde <[email protected]> | 2023-12-01 14:20:51 -0800 |
---|---|---|
committer | git <[email protected]> | 2023-12-05 21:09:53 +0000 |
commit | 5f0ea3f590f8983669fe478bc9eace6880353b84 (patch) | |
tree | ca777e6b654fa43b841e3286a9b35a0869987d2e /spec/bundler/commands/check_spec.rb | |
parent | a33632e1ca7af1e3ba34cff05643aa067561a8cc (diff) |
[rubygems/rubygems] Converts Bundler lockfile checksum validation to opt-in only
Looks for the CHECKSUMS section in the lockfile, activating the feature
only if the section exists. Without a CHECKSUMS section, Bundler will
continue as normal, validating checksums when gems are installed while
checksums from the compact index are present.
https://github.com/rubygems/rubygems/commit/2353cc93a4
Diffstat (limited to 'spec/bundler/commands/check_spec.rb')
-rw-r--r-- | spec/bundler/commands/check_spec.rb | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index dacbd6c45f..ca6a7d1e27 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -406,6 +406,12 @@ RSpec.describe "bundle check" do it "returns success when the Gemfile is satisfied and generates a correct lockfile" do system_gems "depends_on_rack-1.0", "rack-1.0", :gem_repo => gem_repo4, :path => default_bundle_path bundle :check + + checksums = checksums_section_when_existing do |c| + c.no_checksum "depends_on_rack", "1.0" + c.no_checksum "rack", "1.0" + end + expect(out).to include("The Gemfile's dependencies are satisfied") expect(lockfile).to eq <<~L GEM @@ -424,11 +430,7 @@ RSpec.describe "bundle check" do DEPENDENCIES depends_on_rack! - - CHECKSUMS - depends_on_rack (1.0) - rack (1.0) - + #{checksums} BUNDLED WITH #{Bundler::VERSION} L @@ -468,6 +470,12 @@ RSpec.describe "bundle check" do bundle "check --verbose", :dir => tmp.join("bundle-check-issue") + checksums = checksums_section_when_existing do |c| + c.checksum gem_repo4, "awesome_print", "1.0" + c.no_checksum "bundle-check-issue", "9999" + c.checksum gem_repo2, "dex-dispatch-engine", "1.0" + end + expect(File.read(tmp.join("bundle-check-issue/Gemfile.lock"))).to eq <<~L PATH remote: . @@ -491,12 +499,7 @@ RSpec.describe "bundle check" do DEPENDENCIES bundle-check-issue! dex-dispatch-engine! - - CHECKSUMS - #{checksum_for_repo_gem gem_repo4, "awesome_print", "1.0"} - bundle-check-issue (9999) - #{checksum_for_repo_gem gem_repo2, "dex-dispatch-engine", "1.0"} - + #{checksums} BUNDLED WITH #{Bundler::VERSION} L |