summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2018-09-03 07:51:46 +0000
committerColby Swandale <me@colby.fyi>2018-10-05 16:15:43 +1000
commit1e60abf649ddc343a21c62c243047f5eb2cd5a59 (patch)
tree04d9c1085749f31c1c6ae7deb183a01be01dfd62 /spec
parent328b1bdc747ee67f0b4888d2fcfb9f512e1d1924 (diff)
downloadbundler-1e60abf649ddc343a21c62c243047f5eb2cd5a59.tar.gz
Auto merge of #6676 - ankitkataria:gemfile-flag, r=colby-swandale
Add gemfile flag to exec command ### What was the end-user problem that led to this PR? This PR resolves the issue #5924 ### What was your diagnosis of the problem? - added a `gemfile` flag in `cli.rb` - if `options[:gemfile]` is set I created a SharedHelper method `custom_gemfile` which used the predefined `find_file` function to find and set the environment variable with the argument provided (cherry picked from commit c4892480aba36d31a3b6e232f17a705aaad1b730)
Diffstat (limited to 'spec')
-rw-r--r--spec/commands/exec_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index 03212fd9b3..bd3c49baa1 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -6,6 +6,15 @@ RSpec.describe "bundle exec" do
system_gems(system_gems_to_install, :path => :bundle_path)
end
+ it "works with --gemfile flag" do
+ create_file "CustomGemfile", <<-G
+ gem "rack", "1.0.0"
+ G
+
+ bundle "exec --gemfile CustomGemfile rackup"
+ expect(out).to eq("1.0.0")
+ end
+
it "activates the correct gem" do
gemfile <<-G
gem "rack", "0.9.1"