【问题标题】:Error while running spock testing with gradle in eclipse InternalTestExecutionException在 eclipse InternalTestExecutionException 中使用 gradle 运行 spock 测试时出错
【发布时间】: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 个,但我想这不是你的问题?

标签: gradle groovy spock


【解决方案1】:

通过在 build.gradle 文件中添加代码解决了我的上述问题。

应用插件:'groovy'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-12
    • 2017-12-19
    • 2014-08-26
    • 1970-01-01
    相关资源
    最近更新 更多