문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
groovy:unittest [2012/09/17 12:28] kwon37xi |
groovy:unittest [2014/12/22 22:36] (현재) kwon37xi |
||
|---|---|---|---|
| 줄 2: | 줄 2: | ||
| * [[http:// | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| ===== Stub ===== | ===== Stub ===== | ||
| 줄 52: | 줄 54: | ||
| * '' | * '' | ||
| * '' | * '' | ||
| + | * 코드로 테스트 수트 만들기< | ||
| + | def suite = AllTestSuite.suite(" | ||
| + | junit.textui.TestRunner.run(suite) | ||
| + | </ | ||
| + | ===== shouldFail for JUnit 4 ===== | ||
| + | * [[http:// | ||
| + | <code groovy> | ||
| + | class ArithmeticTest { | ||
| + | final shouldFail = new GroovyTestCase().& | ||
| + | @Test | ||
| + | void divideByZero() { | ||
| + | String message = shouldFail(ArithmeticException) { | ||
| + | println 1/0 | ||
| + | } | ||
| + | assertEquals message, " | ||
| + | } | ||
| + | } | ||
| + | </ | ||