Xel*_*ian 6 testing testng gradle spock
如果我们想要用于我们的TestNG测试,我们必须编写如下内容:
dependencies {
compile project(':model')
testCompile 'org.testng:testng:6.8'
}
test.useTestNG()
Run Code Online (Sandbox Code Playgroud)
但是当使用Spock时,我们只指定依赖项
dependencies {
compile project(':model')
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
}
Run Code Online (Sandbox Code Playgroud)
为什么我们必须指定test.useTestNG()?
Spock测试通过JUnit运行,这是Gradle的默认值.或者,可以通过TestNG运行测试.
| 归档时间: |
|
| 查看次数: |
4045 次 |
| 最近记录: |