class RSpec::Matchers::BuiltIn::BePredicate

def matches?(actual)

def matches?(actual)
  @actual = actual
  if is_private_on?( @actual )
    RSpec.deprecate "matching with be_#{predicate.to_s.gsub(/\?$/,'')} on private method #{predicate}",
      :replacement => "`expect(object.send(#{predicate.inspect})).to be_true` or change the method's visibility to public",
      :call_site => caller(0)[3]
  end
  begin
    @result = actual.__send__(predicate, *@args, &@block)
    check_respond_to(predicate)
    return @result
  rescue NameError => predicate_missing_error
    "this needs to be here or rcov will not count this branch even though it's executed in a code example"
  end
  begin
    @result = actual.__send__(present_tense_predicate, *@args, &@block)
    check_respond_to(present_tense_predicate)
    return @result
  rescue NameError
    raise predicate_missing_error
  end
end