Spek fails to run in gradle, but succeeds in intel...
# spek
s
Spek fails to run in gradle, but succeeds in intellij. any thoughts?
r
do you have
org.junit.platform:junit-platform-engine
in your classpath?
s
I just copied the instructions from here https://spekframework.org/setup-jvm/
so no...
I thought maybe it wasn't required anymore.
r
yeah, it should not be required. Doing this:
Copy code
test {
    useJUnitPlatform {
        includeEngines 'spek2'
    }
}
should add it to the test classpath.
s
oh i have that
but it still doesn't work.
n
thats my buildscript section for spec, except for dependencies:
Copy code
// SPEK

repositories {
    maven(url = "<https://dl.bintray.com/spekframework/spek-dev>")
}

val cleanTest by tasks.getting(Delete::class)

tasks.withType<Test> {
    useJUnitPlatform {
        includeEngines("spek2")
    }
    dependsOn(cleanTest)
}
hopefully it helps figure out the diff
dependencies are:
Copy code
testImplementation(group = "org.spekframework.spek2", name = "spek-dsl-jvm", version = "2.0.0-rc.1")
testImplementation(group = "org.spekframework.spek2", name = "spek-runner-junit5", version = "2.0.0-rc.1")
testImplementation(group = "org.junit.platform", name = "junit-platform-engine", version = "1.3.0-RC1")
s
ok, so you still need the engine dependency. that fixed it. thank you.
r
indeed, sorry about that. I had this in my mind https://github.com/spekframework/spek/blob/2.x/samples/jvm/build.gradle, and vaugely remembered not having to specify the junit-platform deps. Aparently the sample didn't exclude it ­čĄŽ.
docs needs to be updated.