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 19:43:51 -0800
commit478e5bca6f7071553221fe5c24c6a89815effa51 (patch)
tree770a20ee9450ee56fe112cc6f0f9ec4527e93009
parentd30026e9c8fc6c98478120866a47ca5b619251b8 (diff)
downloadbundler-478e5bca6f7071553221fe5c24c6a89815effa51.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 c38c3462bf..59a4d7db51 100644
--- a/spec/install/gems/sudo_spec.rb
+++ b/spec/install/gems/sudo_spec.rb
@@ -61,24 +61,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
- expect(gem_home.join('bin/rackup')).to exist
- should_be_installed "rack 1.0"
- end
+ bundle :install, :env => {'GEM_HOME' => gem_home.to_s, 'GEM_PATH' => nil}
+ expect(gem_home.join('bin/rackup')).to exist
+ should_be_installed "rack 1.0", :env => {'GEM_HOME' => gem_home.to_s, 'GEM_PATH' => nil}
end
end