diff options
author | Agis- <corestudiosinc@gmail.com> | 2015-09-15 23:28:54 +0300 |
---|---|---|
committer | Agis- <corestudiosinc@gmail.com> | 2015-09-15 23:37:02 +0300 |
commit | 9e2e8dafce6e98a97545a1aff5bdf3dd00c98cf0 (patch) | |
tree | fe5482b96fefe23682c85cfff25da200d357783a | |
parent | 9cb77343377856af5920691d99ba9075a8bccec2 (diff) | |
download | bundler-9e2e8dafce6e98a97545a1aff5bdf3dd00c98cf0.tar.gz |
Ignore ENV["BUNDLE_GEMFILE"] if it's empty
Fixes #3678.
-rw-r--r-- | lib/bundler/cli.rb | 2 | ||||
-rw-r--r-- | spec/bundler/cli_spec.rb | 13 |
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 |