doc / ch.tutteli.atrium.api.fluent.en_GB / toBeAbsolute

toBeAbsolute

fun <T : Path> Expect<T>.toBeAbsolute(): Expect<T> (source)

Expects that the subject of this expectation (a Path) is an absolute path; meaning that the Path specified in this instance starts at the file system root.

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")).toBeAbsolute()

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

Return
an Expect for the subject of this expectation.

Since
0.17.0