所以我一直在尝试让这些工具一起运行,但我似乎无法正确设置它们。每次出现以下错误时:
The project was not built since its build path is incomplete. Cannot find the class file for org.spockframework.mock.MockController. Fix the build path then try building this project.
我创建了这个 gist .当我运行 gradle chrome test 时,我得到以下输出:
gradle chrome test
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:compileTestJava UP-TO-DATE
:compileTestGroovy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileTestGroovy'.
> org/spockframework/mock/MockController
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
我使用的是 gradle 1.3、geb 0.7.2 和 spock 0.7-groovy-2.0。我还尝试更新 geb 以利用 0.9.0-RC-1。上面的要点应该包含看到相同错误所需的一切。
最佳答案
这是当您运行 Spock 0.7 且 Geb 版本低于 0.9.0-RC-1(与 Spock 0.7 不兼容)时得到的结果。仔细检查您的设置并执行干净的构建。
关于groovy - Geb + Spock + groovy 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13748435/