Sha256: 463e0a2c8db5468cc5d0e0dcc6f1786e5e6da46c058d614747b76da9f4899ca8
Contents?: true
Size: 1.11 KB
Versions: 4
Compression:
Stored size: 1.11 KB
Contents
RSpec::Support.require_rspec_support 'differ' module RSpec module Expectations class << self # @private def differ RSpec::Support::Differ.new( :object_preparer => lambda { |object| RSpec::Matchers::Composable.surface_descriptions_in(object) }, :color => RSpec::Matchers.configuration.color? ) end # Raises an RSpec::Expectations::ExpectationNotMetError with message. # @param [String] message # @param [Object] expected # @param [Object] actual # # Adds a diff to the failure message when `expected` and `actual` are # both present. 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::ExpectedsForMultipleDiffs.from(expected).message_with_diff(message, differ, actual) raise RSpec::Expectations::ExpectationNotMetError, message end end end end
Version data entries
4 entries across 4 versions & 2 rubygems