summaryrefslogtreecommitdiff
path: root/spec/commands/config_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/commands/config_spec.rb')
-rw-r--r--spec/commands/config_spec.rb18
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