[rubygems/rubygems] Fix bundle check exit code when git gem is missing

Make `bundle check` exit with code 1 when gem git source is not yet
checked out.

https://github.com/rubygems/rubygems/commit/93162bf5af
This commit is contained in:
Jerome Dalbert 2024-07-25 02:02:21 -07:00 коммит произвёл git
Родитель 3542ad52e2
Коммит 71dec15a70
2 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -17,7 +17,7 @@ module Bundler
begin
definition.resolve_only_locally!
not_installed = definition.missing_specs
rescue GemNotFound, SolveFailure
rescue GemNotFound, GitError, SolveFailure
Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
Bundler.ui.warn "Install missing gems with `bundle install`."
exit 1

Просмотреть файл

@ -70,6 +70,17 @@ RSpec.describe "bundle check" do
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
gemfile <<-G
source "https://gem.repo1"
gem "rails", git: "git@github.com:rails/rails.git"
G
bundle :check, raise_on_error: false
expect(exitstatus).to eq 1
expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.")
end
it "prints a generic message if you changed your lockfile" do
build_repo2 do
build_gem "rails_pinned_to_old_activesupport" do |s|