class RSpec::Rails::Matchers::BaseMatcher

Base class to build matchers. Should not be instantiated directly.
@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 = RSpec::Matchers::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 = RSpec::Matchers::EnglishPhrasing.split_words(self.class.matcher_name)
  desc << RSpec::Matchers::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 supports_block_expectations?

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