summaryrefslogtreecommitdiff
path: root/spec/install/gems/sudo_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/install/gems/sudo_spec.rb')
-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 1c28c1ccca..5815180d78 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}"
@@ -105,6 +112,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}"