module RSpec::Expectations

def self.configuration

Returns:
  • (RSpec::Expectations::Configuration) - the configuration object
def self.configuration
  @configuration ||= Configuration.new
end

def differ

Other tags:
    Private: -
def differ
  RSpec::Support::Differ.new(
    :object_preparer => Differ::OBJECT_PREPARER,
    :color => RSpec::Matchers.configuration.color?
  )
end

def fail_with(message, expected=nil, actual=nil)

Parameters:
  • actual (Object) --
  • expected (Object) --
  • message (String) --
def fail_with(message, expected=nil, actual=nil)
  unless message
    raise ArgumentError, "Failure message is nil. Does your matcher define the " \
                         "appropriate failure_message[_when_negated] method to return a string?"
  end
  message = ::RSpec::Matchers::MultiMatcherDiff.from(expected, actual).message_with_diff(message, differ)
  RSpec::Support.notify_failure(RSpec::Expectations::ExpectationNotMetError.new message)
end