does kotest support mapping like strikt? ```val su...
# kotest
c
does kotest support mapping like strikt?
Copy code
val subject = Pantheon.NORSE
expectThat(subject)
  .get(Pantheon::ruler) // reference to a property
  .get { toString() }   // return type of a method call
  .isEqualTo("Odin")
s
subject.ruler shouldBe "Odin"
That would be the equivalent for testing a single property
m
Will it convert
ruler
to a String or is
toString()
missing? Seems kind of spooky if it converts
s
I assumed panthon.ruler was a string, so if it's not, then
subject.ruler.toString() shouldBe "Odin"
👍 1
c
The difference is in the failure message.
With the strikt syntax you get something like expected pantheon.Norse to have ruler Odin.
I Guess I can just use strikt with kotest
s
Yeah I see what you mean. The word "ruler" won't be present in the kotest error.
I think the closest right now would be
Copy code
withClue("greek ruler") {
   Pantheon.Greek.ruler() shouldBe "Zeus"
}
Then your error would be something like
Copy code
greek ruler
Expected :"Odin"
Actual   :"Zeus"
Or as you say, you don't have to use kotest assertions (or you can use them and strickt)
c
I’m right now using strikt and minutest, but I’m looking at kotest for the multiplatform support, and because its not junit dependent
s
Right. The JVM support is currently on top of JUnit5, unless you use the experimental gradle plugin, then you can ditch junit completely. The kotest intellij plugin is junit free. Hopefully in 4.4 / 4.5 we can make the JUnit support 2nd class in favour of our native gradle support (the output is much better). The JS support uses the mocha/karma runners (whichever one the JS plugin pulls down now).