summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-06-07 15:54:38 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-06-18 19:14:15 +0900
commit974c40c842b34bc05724e9432e443301a4b2649f (patch)
treec9eadded6fe55bf8597d58b718b7539884bb8091 /spec
parent5454415750fe3e7dd3b4a5e55f128c4393657eaf (diff)
[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/<ruby_abi_version>` 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
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3212
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/install/gems/sudo_spec.rb7
1 files changed, 4 insertions, 3 deletions
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