From 974c40c842b34bc05724e9432e443301a4b2649f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sun, 7 Jun 2020 15:54:38 +0200 Subject: [rubygems/rubygems] Fix some sudo specs to do the right thing on bundler 3 On bundler 3, where the default install path is `.bundle`, these specs were trying to change permissions of the `.bundle/ruby/` folder, which didn't exist yet,so the permission changing command was failing and the spec was not testing the right thing. Change the specs so that the permissions are correctly changed, by first configuring the local path to be `.bundle` (which creates the `.bundle` folder), and then changing permissions of the `.bundle` folder explicitly, which exists already. https://github.com/rubygems/rubygems/commit/2833162fb0 --- spec/bundler/install/gems/sudo_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'spec') diff --git a/spec/bundler/install/gems/sudo_spec.rb b/spec/bundler/install/gems/sudo_spec.rb index bab8412170..a70e90552c 100644 --- a/spec/bundler/install/gems/sudo_spec.rb +++ b/spec/bundler/install/gems/sudo_spec.rb @@ -105,11 +105,12 @@ RSpec.describe "when using sudo", :sudo => true do describe "and BUNDLE_PATH is not writable" do before do - sudo "chmod ugo-w #{default_bundle_path}" + bundle "config set --local path .bundle" + sudo "chmod ugo-w .bundle" end after do - sudo "chmod ugo+w #{default_bundle_path}" + sudo "chmod ugo+w .bundle" end it "installs" do @@ -118,7 +119,7 @@ RSpec.describe "when using sudo", :sudo => true do gem "rack", '1.0' G - expect(default_bundle_path("gems/rack-1.0.0")).to exist + expect(local_gem_path("gems/rack-1.0.0")).to exist expect(the_bundle).to include_gems "rack 1.0" end -- cgit v1.2.3