문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
groovy:unittest [2014/12/22 22:34] kwon37xi |
groovy:unittest [2014/12/22 22:36] (현재) kwon37xi |
||
---|---|---|---|
줄 2: | 줄 2: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | * [[http:// | ||
* [[http:// | * [[http:// | ||
줄 58: | 줄 59: | ||
</ | </ | ||
- | ===== shouldFail ===== | + | ===== shouldFail |
* [[http:// | * [[http:// | ||
+ | <code groovy> | ||
+ | class ArithmeticTest { | ||
+ | final shouldFail = new GroovyTestCase().& | ||
+ | @Test | ||
+ | void divideByZero() { | ||
+ | String message = shouldFail(ArithmeticException) { | ||
+ | println 1/0 | ||
+ | } | ||
+ | assertEquals message, " | ||
+ | } | ||
+ | } | ||
+ | </ |