public class GroovyAssert extends Object
| Constructor and Description |
|---|
GroovyAssert() |
| Modifier and Type | Method and Description |
|---|---|
static Throwable |
shouldFail(Class clazz,
groovy.lang.Closure code)
Asserts that the given code closure fails when it is evaluated
and that a particular type of exception is thrown.
|
static Throwable |
shouldFail(groovy.lang.Closure code)
Asserts that the given code closure fails when it is evaluated
|
static Throwable |
shouldFailWithCause(Class expectedCause,
groovy.lang.Closure code)
Asserts that the given code closure fails when it is evaluated
and that a particular Exception type can be attributed to the cause.
|
public static Throwable shouldFail(groovy.lang.Closure code)
code - the code expected to failpublic static Throwable shouldFail(Class clazz, groovy.lang.Closure code)
clazz - the class of the expected exceptioncode - the closure that should failpublic static Throwable shouldFailWithCause(Class expectedCause, groovy.lang.Closure code)
expectedCause - the class of the expected exceptioncode - the closure that should fail