toStartWith

Expects that the subject of this expectation (a CharSequence) starts with expected.

Return

an Expect for the subject of this expectation.

Samples

expect("ABC").toStartWith("AB")

fails {
    expect("ABC").toStartWith("X")
}
fun <T : Path> Expect<T>.toStartWith(expected: Path): Expect<T>(source)

Expects that the subject of this expectation (a Path) starts with the expected.

Return

an Expect for the subject of this expectation.

Since

0.17.0

Samples

val dir = tempDir.newDirectory("test_dir")

expect(dir).toStartWith(dir.parent)

fails {
    expect(dir).toStartWith(Paths.get("non_existing_dir"))
}