Method: MotionSpec::Matcher::RaiseError#fail!

Defined in:
lib/motion-spec/matcher/raise_error.rb

#fail!(_subject, negated) ⇒ Object



38
39
40
41
42
43
44
45
46
47
# File 'lib/motion-spec/matcher/raise_error.rb', line 38

def fail!(_subject, negated)
  show_class = @error_class != Exception
  show_message = !@error_message.is_a?(String) || !@error_message.empty?
  fail FailedExpectation.new(
    FailMessageRenderer.message_for_raise_error(
      negated, show_class, @error_class, show_message, @error_message,
      @rescued_exception
    )
  )
end