public void notThrown(Class<? extends Throwable> type) {
    Throwable thrown = getSpecificationContext().getThrownException();
    if (thrown == null) return;
    if (type.isAssignableFrom(thrown.getClass())) {
      throw new UnallowedExceptionThrownError(type, thrown);
    }
    ExceptionUtil.sneakyThrow(thrown);
  }
Specifies that no exception of the given type should be
thrown, failing with a {@link UnallowedExceptionThrownError} otherwise.

@param type the exception type that should not be thrown
spock-core/src/main/java/spock/lang/Specification.java