diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2022-05-29 15:30:44 +0200 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-05-30 00:27:43 +0900 |
commit | 08b82e6b40b1dbbff20ba609d7d5eb8106a2d346 (patch) | |
tree | 2262f6b7a2f3515f2caa2e7bd46b765de4553f64 /spec/bundler | |
parent | 373dabe00a71214e12702ff1ccda88f865b504c4 (diff) | |
download | ruby-08b82e6b40b1dbbff20ba609d7d5eb8106a2d346.tar.gz |
[rubygems/rubygems] Ignore `Errno::EROFS` errors when creating `bundler.lock`
Apparently old versions of MacOS would set `GEM_HOME` to a `/System`
folder, and trying to create a file there raises `Errno::EROFS`.
We ignore the error. Any permission issues should be better handled
further down the line.
https://github.com/rubygems/rubygems/commit/ef90c071d0
Diffstat (limited to 'spec/bundler')
-rw-r--r-- | spec/bundler/install/process_lock_spec.rb | 11 |
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 e2b8d20607..1f8c62f26e 100644 --- a/spec/bundler/install/process_lock_spec.rb +++ b/spec/bundler/install/process_lock_spec.rb @@ -42,5 +42,16 @@ RSpec.describe "process lock spec" do expect(processed).to eq true end end + + context "when creating a lock raises Errno::EROFS" do + before { allow(File).to receive(:open).and_raise(Errno::EROFS) } + + 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 |