aboutsummaryrefslogtreecommitdiffstats
path: root/spec/other
diff options
context:
space:
mode:
authorDominique d'Argent <dominique.dargent@me.com>2013-07-11 21:10:53 +0200
committerDominique d'Argent <dominique.dargent@me.com>2013-07-11 21:27:53 +0200
commit47f7c8aa7c343a3ccbf045f7201004d0b2fbcda4 (patch)
tree22d23ce4523f844f6f17ea7738a72b26d1680542 /spec/other
parentea4ae196a3c519781802a050248c6929ef4229b4 (diff)
downloadbundler-47f7c8aa7c343a3ccbf045f7201004d0b2fbcda4.tar.gz
Use RUBYLIB instead of RUBYOPT to add the bundle lib path to ruby $LOAD_PATH.
This allows `bundle exec` to be run when the bundler gem is at a path that includes spaces (which is pretty common in windows environments).
Diffstat (limited to 'spec/other')
-rw-r--r--spec/other/exec_spec.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/spec/other/exec_spec.rb b/spec/other/exec_spec.rb
index 42d059f1..488ba53d 100644
--- a/spec/other/exec_spec.rb
+++ b/spec/other/exec_spec.rb
@@ -108,13 +108,13 @@ describe "bundle exec" do
should_not_be_installed "rack_middleware 1.0"
end
- it "should not duplicate already exec'ed RUBYOPT or PATH" do
+ it "does not duplicate already exec'ed RUBYOPT" do
install_gemfile <<-G
gem "rack"
G
rubyopt = ENV['RUBYOPT']
- rubyopt = "-I#{bundler_path} -rbundler/setup #{rubyopt}"
+ rubyopt = "-rbundler/setup #{rubyopt}"
bundle "exec 'echo $RUBYOPT'"
expect(out).to have_rubyopts(rubyopt)
@@ -123,6 +123,21 @@ describe "bundle exec" do
expect(out).to have_rubyopts(rubyopt)
end
+ it "does not duplicate already exec'ed PATH" do
+ install_gemfile <<-G
+ gem "rack"
+ G
+
+ rubylib = ENV['RUBYLIB']
+ rubylib = "#{bundler_path}"
+
+ bundle "exec 'echo $RUBYLIB'"
+ expect(out.split(File::PATH_SEPARATOR).count(rubylib)).to eq(1)
+
+ bundle "exec 'echo $RUBYLIB'", :env => {"RUBYLIB" => rubylib}
+ expect(out.split(File::PATH_SEPARATOR).count(rubylib)).to eq(1)
+ end
+
it "errors nicely when the argument doesn't exist" do
install_gemfile <<-G
gem "rack"