diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2023-11-27 15:57:45 -0600 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-11-30 03:41:15 +0000 |
commit | 62e2e1da920d15e755f1826b3703ca81366526d8 (patch) | |
tree | 2f50b29ee69152f2af001ae66f7872224de40135 /spec/bundler/commands | |
parent | f2bb5394596c96ce5d7ff415694f3fc83715a96b (diff) | |
download | ruby-62e2e1da920d15e755f1826b3703ca81366526d8.tar.gz |
[rubygems/rubygems] Allow auto-install to install missing git gems
Currently, auto-install with git gems fails, when
it would succeed with a rubygems-source gem
Fix the issue by doing the same fallback for git errors as we do for
missing gems, the git errors should only bubble up in these cases when
the gem is not installed, meaning we want to go through the install flow
(and any persistent errors will be raised through there)
https://github.com/rubygems/rubygems/commit/e25a339f7a
Diffstat (limited to 'spec/bundler/commands')
-rw-r--r-- | spec/bundler/commands/exec_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb index 14255dff60..760ab8dc86 100644 --- a/spec/bundler/commands/exec_spec.rb +++ b/spec/bundler/commands/exec_spec.rb @@ -615,6 +615,23 @@ RSpec.describe "bundle exec" do expect(out).to include("Installing foo 1.0") end + it "performs an automatic bundle install with git gems" do + build_git "foo" do |s| + s.executables = "foo" + end + gemfile <<-G + source "#{file_uri_for(gem_repo1)}" + gem "rack", "0.9.1" + gem "foo", :git => "#{lib_path("foo-1.0")}" + G + + bundle "config set auto_install 1" + bundle "exec foo" + expect(out).to include("Fetching rack 0.9.1") + expect(out).to include("Fetching #{lib_path("foo-1.0")}") + expect(out.lines).to end_with("1.0") + end + it "loads the correct optparse when `auto_install` is set, and optparse is a dependency" do if Gem.rubygems_version < Gem::Version.new("3.3.0.a") skip "optparse is a default gem, and rubygems loads it during install" |