diff options
author | David RodrÃguez <[email protected]> | 2024-10-14 23:02:23 +0200 |
---|---|---|
committer | git <[email protected]> | 2024-10-16 21:57:52 +0000 |
commit | 36b7ad3caa72bc0638d528dcb18682b94ff89b7e () | |
tree | 13dca62f0ed325e10a99a6d5886eff89aa22d542 /spec/bundler/commands/check_spec.rb | |
parent | def5fdf82ab87f17bc0bbc5f232ffa3902433e66 (diff) |
[rubygems/rubygems] Fix `bundle check` sometimes locking gems under the wrong source
https://.com/rubygems/rubygems/commit/1e5780db0a Co-authored-by: Taylor Thurlow <[email protected]>
-rw-r--r-- | spec/bundler/commands/check_spec.rb | 87 |
1 files changed, 78 insertions, 9 deletions
@@ -47,8 +47,8 @@ RSpec.describe "bundle check" do expect(bundled_app_lock).not_to exist end - it "prints a generic error if the missing gems are unresolvable" do - system_gems ["rails-2.3.2"] gemfile <<-G source "https://gem.repo1" @@ -56,10 +56,17 @@ RSpec.describe "bundle check" do G bundle :check, raise_on_error: false - expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.") end - it "prints a generic error if a Gemfile.lock does not exist and a toplevel dependency does not exist" do gemfile <<-G source "https://gem.repo1" gem "rails" @@ -67,7 +74,15 @@ RSpec.describe "bundle check" do bundle :check, raise_on_error: false expect(exitstatus).to be > 0 - expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.") end it "prints a generic error if gem git source is not checked out" do @@ -391,7 +406,7 @@ RSpec.describe "bundle check" do it "returns success when the Gemfile is satisfied" do system_gems "myrack-1.0.0", path: default_bundle_path - bundle :check expect(out).to include("The Gemfile's dependencies are satisfied") end end @@ -416,11 +431,11 @@ RSpec.describe "bundle check" do it "returns success when the Gemfile is satisfied and generates a correct lockfile" do system_gems "depends_on_myrack-1.0", "myrack-1.0", gem_repo: gem_repo4, path: default_bundle_path - bundle :check checksums = checksums_section_when_enabled do |c| - c.no_checksum "depends_on_myrack", "1.0" - c.no_checksum "myrack", "1.0" end expect(out).to include("The Gemfile's dependencies are satisfied") @@ -519,6 +534,60 @@ RSpec.describe "bundle check" do end end describe "BUNDLED WITH" do def lock_with(bundler_version = nil) lock = <<~L |