doc / ch.tutteli.atrium.api.infix.en_GB / absolute

absolute

object absolute : Keyword (source)

A helper construct to allow expressing expectations about a path being absolute. It can be used for a parameterless function so that it has one parameter and thus can be used as infix function.

val s = FileSystems.getDefault().separator
val prefix = if (s == "\\") "C:" else "" // if (s == "\\") => true current os is windows
expect(Paths.get("$prefix${s}absolute${s}path")) toBe absolute

fails {
    expect(Paths.get("relative/path")) toBe absolute
}

Since
0.14.0