diff options
author | Terence Lee <hone02@gmail.com> | 2015-05-04 22:10:38 -0500 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-05-07 08:40:32 +0100 |
commit | de4f10b6f4e582b565d09844abb5d28f31f794e2 (patch) | |
tree | 632e957d0f57184f3189c8fc2334d695ded9785b | |
parent | b6887069aeed5f68577853638c9528b76e7ea899 (diff) | |
download | bundler-de4f10b6f4e582b565d09844abb5d28f31f794e2.tar.gz |
add test for #3277
-rw-r--r-- | spec/install/gems/sudo_spec.rb | 19 |
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 |