summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-26 13:56:51 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-27 13:03:21 +0200
commite66356c316b092864f114fb006772266e8ca4a58 (patch)
tree296de0584db8b87d5dcf211c1f9856d020c46179
parent15d33c2a396e4a403bc7d74cf9d1454de8393f92 (diff)
downloadbundler-e66356c316b092864f114fb006772266e8ca4a58.tar.gz
Reset file ownership after tests changing it
-rw-r--r--spec/install/gems/sudo_spec.rb13
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}"