|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.util.GroovyAssert
public class GroovyAssert
Method Summary | |
---|---|
static java.lang.Throwable
|
shouldFail(Closure code)
Asserts that the given code closure fails when it is evaluated |
static java.lang.Throwable
|
shouldFail(java.lang.Class clazz, Closure code)
Asserts that the given code closure fails when it is evaluated and that a particular exception is thrown. |
static java.lang.Throwable
|
shouldFailWithCause(java.lang.Class clazz, Closure code)
Asserts that the given code closure fails when it is evaluated and that a particular exception can be attributed to the cause. |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Method Detail |
---|
public static java.lang.Throwable shouldFail(Closure code)
code
- the code expected to throw the exception
public static java.lang.Throwable shouldFail(java.lang.Class clazz, Closure code)
clazz
- the class of the expected exceptioncode
- the closure that should fail
public static java.lang.Throwable shouldFailWithCause(java.lang.Class clazz, Closure code)
clazz
- the class of the expected exceptioncode
- the closure that should fail
Groovy Documentation