class Spy::Subroutine

def and_raise(exception = RuntimeError, message = nil)

Returns:
  • (self) -

Other tags:
    Note: -

Overloads:
  • and_raise(exception_instance)
  • and_raise(ExceptionClass, message)
  • and_raise(ExceptionClass)
  • and_raise
def and_raise(exception = RuntimeError, message = nil)
  if exception.respond_to?(:exception)
    exception = message ? exception.exception(message) : exception.exception
  end
  @plan = Proc.new { raise exception }
end