summaryrefslogtreecommitdiff
path: root/spec/bundler/install
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-05-29 13:51:13 +0200
committergit <svn-admin@ruby-lang.org>2022-05-29 22:19:35 +0900
commit373dabe00a71214e12702ff1ccda88f865b504c4 (patch)
tree64b35011b1fba5fda87338eca9d6e05cde83013c /spec/bundler/install
parent931b013b9fa51f93db5b846882e988c7a8e3582f (diff)
[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
Diffstat (limited to 'spec/bundler/install')
-rw-r--r--spec/bundler/install/process_lock_spec.rb11
1 files changed, 11 insertions, 0 deletions
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