diff options
author | Vyacheslav Alexeev <alexeev.corp@gmail.com> | 2022-01-11 23:38:32 +0800 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-01-13 18:16:05 +0900 |
commit | d0a063794873eafed413957cb7ab93279945258a (patch) | |
tree | 5d32e4f70217b84f08e03ca80283197c499f8f3f /spec/bundler/commands/doctor_spec.rb | |
parent | 9828502570acce53f4094c23756bc82bd256eab7 (diff) |
[rubygems/rubygems] Use `Fiddle` in `bundle doctor` to check for dynamic library presence
https://github.com/rubygems/rubygems/commit/ecd495ce1b
Diffstat (limited to 'spec/bundler/commands/doctor_spec.rb')
-rw-r--r-- | spec/bundler/commands/doctor_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/bundler/commands/doctor_spec.rb b/spec/bundler/commands/doctor_spec.rb index 860b638f06..1eeb276105 100644 --- a/spec/bundler/commands/doctor_spec.rb +++ b/spec/bundler/commands/doctor_spec.rb @@ -49,8 +49,8 @@ RSpec.describe "bundle doctor" do doctor = Bundler::CLI::Doctor.new({}) expect(doctor).to receive(:bundles_for_gem).exactly(2).times.and_return ["/path/to/rack/rack.bundle"] expect(doctor).to receive(:dylibs).exactly(2).times.and_return ["/usr/lib/libSystem.dylib"] - allow(File).to receive(:exist?).with("/usr/lib/libSystem.dylib").and_return(true) - expect { doctor.run }.not_to(raise_error, @stdout.string) + allow(Fiddle).to receive(:dlopen).with("/usr/lib/libSystem.dylib").and_return(true) + expect { doctor.run }.not_to raise_error expect(@stdout.string).to be_empty end @@ -58,7 +58,7 @@ RSpec.describe "bundle doctor" do doctor = Bundler::CLI::Doctor.new({}) expect(doctor).to receive(:bundles_for_gem).exactly(2).times.and_return ["/path/to/rack/rack.bundle"] expect(doctor).to receive(:dylibs).exactly(2).times.and_return ["/usr/local/opt/icu4c/lib/libicui18n.57.1.dylib"] - allow(File).to receive(:exist?).with("/usr/local/opt/icu4c/lib/libicui18n.57.1.dylib").and_return(false) + allow(Fiddle).to receive(:dlopen).with("/usr/local/opt/icu4c/lib/libicui18n.57.1.dylib").and_raise(Fiddle::DLError) expect { doctor.run }.to raise_error(Bundler::ProductionError, strip_whitespace(<<-E).strip), @stdout.string The following gems are missing OS dependencies: * bundler: /usr/local/opt/icu4c/lib/libicui18n.57.1.dylib |