public function throws($exception = null)
{
if (0 === func_num_args()) {
return $this->doesWith(function () {
throw new Exception();
}, array(), false, false, false);
}
foreach (func_get_args() as $exception) {
if (is_string($exception)) {
$exception = new Exception($exception);
} elseif ($exception instanceof InstanceHandle) {
$exception = $exception->get();
}
$this->doesWith(function () use($exception) {
throw $exception;
}, array(), false, false, false);
}
return $this;
}