summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2015-05-04 22:10:38 -0500
committerTerence Lee <hone02@gmail.com>2015-05-05 00:11:54 -0500
commit457ab53d0b018f8577d35a98a1171663ec6f337e (patch)
treeff8fcd6c975f756812082dd5638400aa1a3a3c57
parent94be4481dd55c7c0a562edcdc72d28b7bba3b500 (diff)
downloadbundler-457ab53d0b018f8577d35a98a1171663ec6f337e.tar.gz
add test for #3277
-rw-r--r--spec/install/gems/sudo_spec.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb
index 366432188b..aa06584fb3 100644
--- a/spec/install/gems/sudo_spec.rb
+++ b/spec/install/gems/sudo_spec.rb
@@ -96,8 +96,11 @@ describe "when using sudo", :sudo => true do
end
describe "and BUNDLE_PATH is not writable" do
- it "installs" do
+ before do
sudo "chmod ugo-w #{default_bundle_path}"
+ end
+
+ it "installs" do
install_gemfile <<-G
source "file://#{gem_repo1}"
gem "rack", '1.0'
@@ -106,6 +109,20 @@ describe "when using sudo", :sudo => true do
expect(default_bundle_path("gems/rack-1.0.0")).to exist
should_be_installed "rack 1.0"
end
+
+ it "cleans up the tmpdirs generated" do
+ Dir.glob("#{Dir.tmpdir}/bundler*").each do |tmpdir|
+ FileUtils.remove_entry_secure(tmpdir)
+ end
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+ tmpdirs = Dir.glob("#{Dir.tmpdir}/bundler*")
+
+ expect(tmpdirs).to be_empty
+ end
end
describe "and GEM_HOME is not writable" do