diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-26 13:56:51 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-05-27 13:03:21 +0200 |
commit | e66356c316b092864f114fb006772266e8ca4a58 (patch) | |
tree | 296de0584db8b87d5dcf211c1f9856d020c46179 | |
parent | 15d33c2a396e4a403bc7d74cf9d1454de8393f92 (diff) | |
download | bundler-e66356c316b092864f114fb006772266e8ca4a58.tar.gz |
Reset file ownership after tests changing it
-rw-r--r-- | spec/install/gems/sudo_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb index 8338a7794b..0d2d6b7eb4 100644 --- a/spec/install/gems/sudo_spec.rb +++ b/spec/install/gems/sudo_spec.rb @@ -3,13 +3,20 @@ RSpec.describe "when using sudo", :sudo => true do describe "and BUNDLE_PATH is writable" do context "but BUNDLE_PATH/build_info is not writable" do + let(:subdir) do + system_gem_path("cache") + end + before do bundle! "config set path.system true" - subdir = system_gem_path("cache") subdir.mkpath sudo "chmod u-w #{subdir}" end + after do + sudo "chmod u+w #{subdir}" + end + it "installs" do install_gemfile <<-G source "file://#{gem_repo1}" @@ -101,6 +108,10 @@ RSpec.describe "when using sudo", :sudo => true do sudo "chmod ugo-w #{default_bundle_path}" end + after do + sudo "chmod ugo+w #{default_bundle_path}" + end + it "installs" do install_gemfile <<-G source "file://#{gem_repo1}" |