diff options
| author | Josh Nichols <josh.nichols@gusto.com> | 2023-03-28 15:45:41 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-04-25 18:46:05 +0000 |
| commit | 6f4f360fc46269eaba753cafe557519677a45a11 (patch) | |
| tree | 438f3607f1f8298f5075e04dc083b29f26dbc526 /spec | |
| parent | b6489e9f62dae9e62a4f978e0cb1091ab13c274c (diff) | |
[rubygems/rubygems] Add auto_install support to require "bundler/setup"
We have some places that already use `bundle config auto_install true`,
ie:
https://github.com/technicalpickles/rubygems/blob/7a144f3374f6a400cc9832f072dc1fc0bca8c724/bundler/lib/bundler/cli.rb#L11
This applies the same logic (copy and pasted) to happen when you
`require "bundler/setup"`.
https://github.com/rubygems/rubygems/commit/bb3c922341
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/bundler/runtime/setup_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb index ccfe5d55b6..0344d24223 100644 --- a/spec/bundler/runtime/setup_spec.rb +++ b/spec/bundler/runtime/setup_spec.rb @@ -1599,4 +1599,19 @@ end sys_exec "#{Gem.ruby} #{script}", raise_on_error: false expect(out).to include("requiring foo used the monkeypatch") end + + it "performs an automatic bundle install" do + gemfile <<-G + source "#{file_uri_for(gem_repo1)}" + gem "rack", :group => :test + G + + bundle "config set auto_install 1" + + ruby <<-RUBY + require 'bundler/setup' + RUBY + expect(err).to be_empty + expect(out).to include("Installing rack 1.0.0") + end end |
