|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.test.GroovyAssert
public class GroovyAssert
Method Summary | |
---|---|
static Throwable
|
shouldFail(Closure code)
Asserts that the given code closure fails when it is evaluated |
static Throwable
|
shouldFail(Class clazz, Closure code)
Asserts that the given code closure fails when it is evaluated and that a particular type of exception is thrown. |
static Throwable
|
shouldFailWithCause(Class expectedCause, 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. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Method Detail |
---|
public static Throwable shouldFail(Closure code)
code
- the code expected to fail
public static Throwable shouldFail(Class clazz, Closure code)
clazz
- the class of the expected exceptioncode
- the closure that should fail
public static Throwable shouldFailWithCause(Class expectedCause, Closure code)
If a match is found, the matching exception is returned otherwise the method will fail.
expectedCause
- the class of the expected exceptioncode
- the closure that should fail
Copyright © 2003-2013 The Codehaus. All rights reserved.