load_path: trim entries where possible to fix Ruby crashes

This commit is contained in:
Bo Anderson 2020-04-01 10:23:18 +01:00
parent ed0985783a
commit 4265540cc4
2 changed files with 4 additions and 6 deletions

View File

@ -4,6 +4,9 @@ require "pathname"
HOMEBREW_LIBRARY_PATH = Pathname(__dir__).realpath.freeze HOMEBREW_LIBRARY_PATH = Pathname(__dir__).realpath.freeze
$LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.to_s) unless $LOAD_PATH.include?(HOMEBREW_LIBRARY_PATH.to_s) $LOAD_PATH.push HOMEBREW_LIBRARY_PATH.to_s
require "vendor/bundle/bundler/setup" require "vendor/bundle/bundler/setup"
$LOAD_PATH.select! { |d| Pathname(d).directory? }
$LOAD_PATH.uniq!

View File

@ -9,11 +9,6 @@ RSpec::Matchers.define_negated_matcher :be_a_failure, :be_a_success
RSpec.shared_context "integration test" do RSpec.shared_context "integration test" do
extend RSpec::Matchers::DSL extend RSpec::Matchers::DSL
if OS.mac? &&
!RUBY_BIN.to_s.match?(%r{^/(System/Library/Frameworks/Ruby\.framework/Versions/(Current|\d+\.\d+)/)usr/bin$})
skip "integration test requires system Ruby"
end
matcher :be_a_success do matcher :be_a_success do
match do |actual| match do |actual|
status = actual.is_a?(Proc) ? actual.call : actual status = actual.is_a?(Proc) ? actual.call : actual