toBeAbsolute

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.

Return

an Expect for the subject of this expectation.

Since

0.17.0

Samples

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()
}