summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAgis- <corestudiosinc@gmail.com>2015-09-15 23:28:54 +0300
committerAgis- <corestudiosinc@gmail.com>2015-09-15 23:37:02 +0300
commit9e2e8dafce6e98a97545a1aff5bdf3dd00c98cf0 (patch)
treefe5482b96fefe23682c85cfff25da200d357783a
parent9cb77343377856af5920691d99ba9075a8bccec2 (diff)
downloadbundler-9e2e8dafce6e98a97545a1aff5bdf3dd00c98cf0.tar.gz
Ignore ENV["BUNDLE_GEMFILE"] if it's empty
Fixes #3678.
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--spec/bundler/cli_spec.rb13
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index bc03b015ad..5ddb6f12db 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -17,7 +17,7 @@ module Bundler
super
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
- ENV["BUNDLE_GEMFILE"] = File.expand_path(custom_gemfile) if custom_gemfile
+ ENV["BUNDLE_GEMFILE"] = File.expand_path(custom_gemfile) if custom_gemfile && !custom_gemfile.empty?
Bundler.settings[:retry] = options[:retry] if options[:retry]
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index 32eecbc49d..1d5ee7b072 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -24,4 +24,17 @@ describe "bundle executable" do
expect(exitstatus).to be_zero if exitstatus
expect(out).to eq("Hello, world")
end
+
+ context "when ENV['BUNDLE_GEMFILE'] is set to an empty string" do
+ it "ignores it" do
+ gemfile bundled_app("Gemfile"), <<-G
+ source "file://#{gem_repo1}"
+ gem 'rack'
+ G
+
+ bundle :install, :env => { "BUNDLE_GEMFILE" => "" }
+
+ should_be_installed "rack 1.0.0"
+ end
+ end
end