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

has

infix fun <E, T : Iterable<E>> Expect<T>.has(next: next): Expect<T>

Expects that the subject of the assertion (an Iterable) has at least one element.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
An Expect for the current subject of the assertion.

Since
0.12.0

infix fun <T : Path> Expect<T>.has(directoryEntries: DirectoryEntries): Expect<T>

Expects that the subject of the assertion (a Path) is a directory having the provided entries. That means that there is a file system entry at the location the Path points to and that it is a directory. Furthermore, every argument string resolved against the subject yields an existing file system entry.

This assertion resolves symbolic links for the subject, but not for the entries. Therefore, if a symbolic link exists at the location the subject points to, the search will continue at the location the link points at. If a symbolic link exists at one of the entries, this will fulfill the respective assertion and the entry’s symbolic link will not be followed.

This assertion is not atomic with respect to concurrent file system operations on the paths the assertions work on. The result, in particular its extended explanations, may be wrong if such concurrent file system operations take place.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
An Expect for the current subject of the assertion.

See Also

directoryEntries

hasDirectoryEntry

Since
0.14.0