【发布时间】:2018-04-17 16:49:10
【问题描述】:
在 Eclipse 中使用 gradle 运行 spock 测试时出现异常。在 Gradle 任务选项卡“运行构建”中有一个红色的失败图标,当我右键单击它以查看它给出 InternalTestExecutrionException 的错误时。
org.gradle.tooling.internal.protocol.test.InternalTestExecutionException:运行测试时出错
我的代码非常简单,下面是我在 gradle 项目构建中缺少的代码。
import spock.lang.*
class HelloSpockSpec extends spock.lang.Specification {
def "length of Spock's and his friends' names"() {
expect:
name.size() == length
where:
name | length
"Spock" | 3
"Kirk" | 4
"Scotty" | 6
}
}
【问题讨论】:
-
嗯,“Spock”的长度是 4 个字符,而不是 3 个,但我想这不是你的问题?