diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2018-09-25 16:31:25 -0300 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-03-09 18:25:09 +0100 |
commit | a45ed77a067f0fbef8d073281d8a6f2f5644b746 (patch) | |
tree | ed50abebb594a663cc7a9e54f82a994ca1c79962 /spec/commands/config_spec.rb | |
parent | e7b9ff14dd3f790b03342e02770f8cf411abc705 (diff) | |
download | bundler-a45ed77a067f0fbef8d073281d8a6f2f5644b746.tar.gz |
Resolve gemfile from config in the general case
For example, when using `bundler` via `-rbundler/setup`.
Diffstat (limited to 'spec/commands/config_spec.rb')
-rw-r--r-- | spec/commands/config_spec.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb index e58a266212..11fdd1ac78 100644 --- a/spec/commands/config_spec.rb +++ b/spec/commands/config_spec.rb @@ -518,17 +518,33 @@ end RSpec.describe "setting gemfile via config" do context "when only the non-default Gemfile exists" do - it "persists the gemfile location to .bundle/config" do + before do gemfile bundled_app("NotGemfile"), <<-G source "#{file_uri_for(gem_repo1)}" gem 'rack' G bundle "config set --local gemfile #{bundled_app("NotGemfile")}" + end + + it "persists the gemfile location to .bundle/config" do expect(File.exist?(bundled_app(".bundle/config"))).to eq(true) bundle "config list" expect(out).to include("NotGemfile") end + + it "gets used when requiring bundler/setup" do + bundle :install + code = "puts $LOAD_PATH.count {|path| path =~ /rack/} == 1" + + gemfile <<-G + source "#{file_uri_for(gem_repo1)}" + G + + ruby! code, :env => { "RUBYOPT" => "-r#{lib_dir}/bundler/setup" }, :no_lib => true + + expect(out).to eq("true") + end end end |