summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2013-02-13 14:17:03 -0800
committerAndre Arko <andre@arko.net>2013-02-13 14:17:52 -0800
commitef1d15786f94183ef60075d08fd2ac671a5c2b6a (patch)
tree37e5d326b9317f00e0f72fde4aec7120f6e7e75b
parent6a99fe4b8fc5be6459701a4408f6bc83fba0ecab (diff)
downloadbundler-ef1d15786f94183ef60075d08fd2ac671a5c2b6a.tar.gz
set the right ENV while checking for sudo install
-rw-r--r--spec/install/gems/sudo_spec.rb26
1 files changed, 11 insertions, 15 deletions
diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb
index 3894f76811..6320a8f475 100644
--- a/spec/install/gems/sudo_spec.rb
+++ b/spec/install/gems/sudo_spec.rb
@@ -50,24 +50,20 @@ describe "when using sudo", :sudo => true do
end
end
- describe "and BUNDLE_PATH is not writable" do
+ describe "and GEM_HOME is not writable" do
it "installs" do
- begin
- gem_home = tmp('sudo_gem_home')
-
- sudo "mkdir -p #{gem_home}"
- sudo "chmod ugo-w #{gem_home}"
- ENV['GEM_HOME'] = gem_home.to_s
- ENV['GEM_PATH'] = nil
+ gem_home = tmp('sudo_gem_home')
+ sudo "mkdir -p #{gem_home}"
+ sudo "chmod ugo-w #{gem_home}"
- install_gemfile <<-G
- source "file://#{gem_repo1}"
- gem "rack", '1.0'
- G
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack", '1.0'
+ G
- gem_home.join('bin/rackup').should exist
- should_be_installed "rack 1.0"
- end
+ bundle :install, :env => {'GEM_HOME' => gem_home.to_s, 'GEM_PATH' => nil}
+ gem_home.join('bin/rackup').should exist
+ should_be_installed "rack 1.0", :env => {'GEM_HOME' => gem_home.to_s, 'GEM_PATH' => nil}
end
end