class RSpec::Matchers::BuiltIn::BaseMatcher

class. If/when this changes, we will announce it and remove this warning.
We strongly recommend that you do not base your custom matchers on this
This class is for internal use, and subject to change without notice.
### Warning:
rspec-expectations and rspec-rails.
Used internally as a base class for matchers that ship with
@api private

def self.matcher_name

Other tags:
    Private: -
def self.matcher_name
  @matcher_name ||= underscore(name.split('::').last)
end

def self.underscore(camel_cased_word)

Other tags:
    Private: -
def self.underscore(camel_cased_word)
  word = camel_cased_word.to_s.dup
  word.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
  word.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
  word.tr!('-', '_')
  word.downcase!
  word
end

def actual_formatted

Other tags:
    Private: -
def actual_formatted
  RSpec::Support::ObjectFormatter.format(@actual)
end

def assert_ivars(*expected_ivars)

def assert_ivars(*expected_ivars)
  return unless (expected_ivars - present_ivars).any?
  ivar_list = EnglishPhrasing.list(expected_ivars)
  raise "#{self.class.name} needs to supply#{ivar_list}"
end

def description

Returns:
  • (String) -

Other tags:
    Api: - private
def description
  desc = EnglishPhrasing.split_words(self.class.matcher_name)
  desc << EnglishPhrasing.list(@expected) if defined?(@expected)
  desc
end

def diffable?

Other tags:
    Api: - private
def diffable?
  false
end

def expected_formatted

Other tags:
    Private: -
def expected_formatted
  RSpec::Support::ObjectFormatter.format(@expected)
end

def expects_call_stack_jump?

Other tags:
    Api: - private
def expects_call_stack_jump?
  false
end

def initialize(expected=UNDEFINED)

def initialize(expected=UNDEFINED)
  @expected = expected unless UNDEFINED.equal?(expected)
end

def match_unless_raises(*exceptions)

Other tags:
    Api: - private
def match_unless_raises(*exceptions)
  exceptions.unshift Exception if exceptions.empty?
  begin
    yield
    true
  rescue *exceptions => @rescued_exception
    false
  end
end

def matcher_name

Other tags:
    Private: -
def matcher_name
  if defined?(@matcher_name)
    @matcher_name
  else
    self.class.matcher_name
  end
end

def matches?(actual)

Other tags:
    Api: - private
def matches?(actual)
  @actual = actual
  match(expected, actual)
end

def present_ivars

:nocov:
def present_ivars
  instance_variables.map(&:to_sym)
end

def supports_block_expectations?

Other tags:
    Api: - private
def supports_block_expectations?
  false
end

def supports_value_expectations?

Other tags:
    Private: -
def supports_value_expectations?
  true
end