From 373dabe00a71214e12702ff1ccda88f865b504c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sun, 29 May 2022 13:51:13 +0200 Subject: [rubygems/rubygems] Ignore `Errno::EPERM` errors when creating `bundler.lock` This kind of error can happen when setting `GEM_HOME` to a path under MacOS System Integrity Protection. We ignore the error. Any permission issues should be better handled further down the line. https://github.com/rubygems/rubygems/commit/174cb66863 --- spec/bundler/install/process_lock_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spec/bundler/install') diff --git a/spec/bundler/install/process_lock_spec.rb b/spec/bundler/install/process_lock_spec.rb index dac0d34bc4..e2b8d20607 100644 --- a/spec/bundler/install/process_lock_spec.rb +++ b/spec/bundler/install/process_lock_spec.rb @@ -31,5 +31,16 @@ RSpec.describe "process lock spec" do expect(processed).to eq true end end + + context "when creating a lock raises Errno::EPERM" do + before { allow(File).to receive(:open).and_raise(Errno::EPERM) } + + it "skips creating the lock file and yields" do + processed = false + Bundler::ProcessLock.lock(default_bundle_path) { processed = true } + + expect(processed).to eq true + end + end end end -- cgit v1.2.3