summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-02-03 11:50:59 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2020-02-03 12:27:26 +0100
commit2a62902a202c3fc0d576b016d28a93f0d18f955f (patch)
treed57243bffe1d1e4dce98db5eb7ea29a76c7124da /spec
parent203d02c3670083a95733afc1a9d7a870d1ae1c34 (diff)
downloadbundler-2a62902a202c3fc0d576b016d28a93f0d18f955f.tar.gz
Fix config location edge caseapp_config_path_absolute
If `BUNDLE_APP_CONFIG` is set to an absolute path, and there's no Gemfile up in the directory hierarchy, bundler would end up using the default config location instead of the customized one. This commit fixes that.
Diffstat (limited to 'spec')
-rw-r--r--spec/commands/config_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb
index 7a45dd0dd7..3a6b72d988 100644
--- a/spec/commands/config_spec.rb
+++ b/spec/commands/config_spec.rb
@@ -35,7 +35,7 @@ RSpec.describe ".bundle/config" do
end
end
- describe "location" do
+ describe "location with a gemfile" do
before :each do
gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
@@ -64,6 +64,16 @@ RSpec.describe ".bundle/config" do
end
end
+ describe "location without a gemfile" do
+ it "works with an absolute path" do
+ ENV["BUNDLE_APP_CONFIG"] = tmp("foo/bar").to_s
+ bundle "config set --local path vendor/bundle"
+
+ expect(bundled_app(".bundle")).not_to exist
+ expect(tmp("foo/bar/config")).to exist
+ end
+ end
+
describe "global" do
before(:each) do
install_gemfile <<-G