Hello, I am trying out Spek 2 with Truth. I have a...
# spek
r
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
can you try running
gradle test
with
--info
? There might be some failure during the discovery phase.
r
Does this help?
r
Fixed in master (https://github.com/spekframework/spek/issues/684), please use
2.0.2
for now.
@ragunathjawahar are you able to try this build out? https://bintray.com/spekframework/spek-dev/spek2/2.1.0-alpha.0.3%2B45afbe2
r
Sorry, for the delay. Tried out
2.0.4
, this has been fixed. Thank you very much.
🎉 1