diff options
author | Andre Arko <andre@arko.net> | 2015-05-04 22:53:29 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-05-04 22:53:29 -0700 |
commit | 2b43de4b4746d7baf16d418f880b379884989ec0 (patch) | |
tree | 18e126c927d24263578c2a22c5ee12b1f5f094d3 /spec | |
parent | ae865a073c4e713d6f9c2a6143a0e81041031eb8 (diff) | |
parent | 457ab53d0b018f8577d35a98a1171663ec6f337e (diff) | |
download | bundler-2b43de4b4746d7baf16d418f880b379884989ec0.tar.gz |
Merge pull request #3618 from hone/master
add test for #3277
Diffstat (limited to 'spec')
-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 36643218..aa06584f 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 |