目前,我正在Unresolved reference: spek
接受:Unresolved reference: test
testCompile / testRuntime
project(":core") {
apply plugin: "kotlin"
dependencies {
// ... other dependencies
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
testCompile "org.jetbrains.spek:spek-api:$spekVersion"
testRuntime "org.jetbrains.spek:spek-junit-platform-engine:$spekVersion"
testCompile "com.nhaarman:mockito-kotlin:$mockitoVersion"
testCompile "com.natpryce:hamkrest:$hamkrestVersion"
}
}
但是,当我用 切换它们时compile / runtime
,我可以成功运行测试!
这是我的 spek 测试:
package com.mysampleapp
import org.jetbrains.spek.api.Spek
import org.jetbrains.spek.api.dsl.describe
import org.jetbrains.spek.api.dsl.it
import kotlin.test.assertEquals
class DummySpec : Spek({
describe("a dummy") {
it("contains a number") {
val dummy = Dummy(1)
assertEquals(1, dummy.number)
}
}
})
有人可以帮我调试吗?
谢谢