Merge pull request #7251 from Bo98/load_path

load_path: trim entries where possible to fix Ruby crashes
This commit is contained in:
Mike McQuaid 2020-04-01 12:22:09 +01:00 committed by GitHub
commit e2b08d47a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -4,6 +4,9 @@ require "pathname"
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"
$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
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
match do |actual|
status = actual.is_a?(Proc) ? actual.call : actual