Hello, I am trying out Spek 2 with Truth. I have a passing test despite a failing assertion. I tried running the tests from Gradle, it still passes. Can someone help?
CanaryTest.kt
Copy code
package dev.ragunath.spek2
import com.google.common.truth.Truth.assertThat
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe
class CanaryTest : Spek({
describe("A test environment") {
it("is ready to run tests") {
assertThat("a").isEqualTo("b") // <- Failing assertion.
}
}
})
Also, here is my
build.gradle
.
Copy code
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.31'
}
group 'dev.ragunath'
version '0.1.0-SNAPSHOT'
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation 'io.arrow-kt:arrow-core-data:0.9.0'
// Spek
testImplementation 'org.spekframework.spek2:spek-dsl-jvm:2.0.3'
testRuntimeOnly "org.spekframework.spek2:spek-runner-junit5:2.0.3"
testRuntimeOnly "org.jetbrains.kotlin:kotlin-reflect:1.3.31"
// Truth
testImplementation 'com.google.truth:truth:0.44'
}
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}
r
raniejade
05/02/2019, 5:25 AM
can you try running
gradle test
with
--info
? There might be some failure during the discovery phase.