summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2011-09-24 15:37:06 -0700
committerAndre Arko <andre@arko.net>2011-09-24 16:32:09 -0700
commitaf6badf5080ac55c1d5f83795f44a261dc8779bf (patch)
treeb2e26c16adff798f337b4aa04ef56d2d85103dde /spec
parentd02fa2740f75b088409d721e08b675a683f0f5e8 (diff)
downloadbundler-af6badf5080ac55c1d5f83795f44a261dc8779bf.tar.gz
Add Bundler.system_bindir, defaulted to Gem.bindir
This allows users to tell Bundler where to put the binstubs for system gems, much like the -n option in ~/.gemrc for Rubygems. If you set one, it probably makes sense to set the other. If you don't set system_bindir, though, Bundler will install system binstubs into Gem.bindir, regardless of what Rubygems does. refs #1417
Diffstat (limited to 'spec')
-rw-r--r--spec/install/gems/simple_case_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/install/gems/simple_case_spec.rb b/spec/install/gems/simple_case_spec.rb
index 86bdf5a8da..162eda35f4 100644
--- a/spec/install/gems/simple_case_spec.rb
+++ b/spec/install/gems/simple_case_spec.rb
@@ -733,22 +733,22 @@ describe "bundle install with gem sources" do
end
end
- describe "when Gem.bindir is hardcoded to a root-owned directory" do
- # On OS X, Gem.bindir is hardcoded to /usr/bin. :(
- it "installs binstubs into Gem.dir+'/bin' instead" do
+ describe "when system_bindir is set" do
+ # On OS X, Gem.bindir defaults to /usr/bin, so system_bindir is useful if
+ # you want to avoid sudo installs for system gems with OS X's default ruby
+ it "overrides Gem.bindir" do
Pathname.new("/usr/bin").should_not be_writable
-
gemfile <<-G
require 'rubygems'
- def Gem.bindir(dir=Gem.dir); "/usr/bin"; end
-
+ def Gem.bindir; "/usr/bin"; end
source "file://#{gem_repo1}"
gem "rack"
G
+ config "BUNDLE_SYSTEM_BINDIR" => system_gem_path('altbin').to_s
bundle :install
should_be_installed "rack 1.0.0"
- system_gem_path("bin/rackup").should exist
+ system_gem_path("altbin/rackup").should exist
end
end