Package-level declarations

Functions

Link copied to clipboard
fun <E, T : Iterable<E>> Assert<T>.any(f: (Assert<E>) -> Unit)

Asserts on each item in the iterable, passing if any of the items pass. The given lambda will be run for each item.

fun <E, T : Sequence<E>> Assert<T>.any(f: (Assert<E>) -> Unit)

Asserts on each item in the sequence, passing if any of the items pass. The given lambda will be run for each item.

Link copied to clipboard
fun <E, T : Iterable<E>> Assert<T>.atLeast(times: Int, f: (Assert<E>) -> Unit)

Asserts on each item in the iterable, passing if at least times items pass. The given lambda will be run for each item.

fun <E, T : Sequence<E>> Assert<T>.atLeast(times: Int, f: (Assert<E>) -> Unit)

Asserts on each item in the sequence, passing if at least times items pass. The given lambda will be run for each item.

Link copied to clipboard
fun <E, T : Iterable<E>> Assert<T>.atMost(times: Int, f: (Assert<E>) -> Unit)

Asserts on each item in the iterable, passing if at most times items pass. The given lambda will be run for each item.

fun <E, T : Sequence<E>> Assert<T>.atMost(times: Int, f: (Assert<E>) -> Unit)

Asserts on each item in the sequence, passing if at most times items pass. The given lambda will be run for each item.

Link copied to clipboard

Returns an assert on the file's contents as bytes.

Assert on file bytes

Link copied to clipboard

Returns an assert on the throwable's cause.

Link copied to clipboard
fun Assert<Array<*>>.contains(element: Any?)

Asserts the array contains the expected element, using in.

fun Assert<Iterable<*>>.contains(element: Any?)

Asserts the iterable contains the expected element, using in.

fun <K, V> Assert<Map<K, V>>.contains(element: Pair<K, V>)
fun <K, V> Assert<Map<K, V>>.contains(key: K, value: V)

Asserts the map contains the expected key-value pair.

fun Assert<Sequence<*>>.contains(element: Any?)

Asserts the sequence contains the expected element, using in.

fun Assert<CharSequence>.contains(vararg expected: CharSequence, ignoreCase: Boolean = false)

Asserts the char sequence contains the expected subsequence(s).

fun Assert<CharSequence>.contains(expected: CharSequence, ignoreCase: Boolean = false)

Asserts the char sequence contains the expected subsequence.

fun Assert<CharSequence>.contains(expected: Iterable<CharSequence>, ignoreCase: Boolean = false)

Asserts the char sequence contains the expected char sequences.

Link copied to clipboard
fun Assert<Array<*>>.containsAll(vararg elements: Any?)

Asserts the array contains at least the expected elements, in any order. The array may also contain additional elements.

fun Assert<Iterable<*>>.containsAll(vararg elements: Any?)

Asserts the iterable contains at least the expected elements, in any order. The collection may also contain additional elements.

fun <K, V> Assert<Map<K, V>>.containsAll(vararg elements: Pair<K, V>)

Asserts the map contains at least the expected elements. The map may also contain additional elements.

fun Assert<Sequence<*>>.containsAll(vararg elements: Any?)

Asserts the sequence contains at least the expected elements, in any order. The collection may also contain additional elements.

Link copied to clipboard
fun Assert<Array<*>>.containsAtLeast(vararg elements: Any?)

Asserts the array contains at least the expected elements, in any order. The array may also contain additional elements.

fun Assert<Iterable<*>>.containsAtLeast(vararg elements: Any?)

Asserts the iterable contains at least the expected elements, in any order. The collection may also contain additional elements.

fun <K, V> Assert<Map<K, V>>.containsAtLeast(vararg elements: Pair<K, V>)

Asserts the map contains at least the expected elements. The map may also contain additional elements.

fun Assert<Sequence<*>>.containsAtLeast(vararg elements: Any?)

Asserts the sequence contains at least the expected elements, in any order. The collection may also contain additional elements.

Link copied to clipboard
fun Assert<Array<*>>.containsExactly(vararg elements: Any?)

Asserts the array contains exactly the expected elements. They must be in the same order and there must not be any extra elements.

fun Assert<List<*>>.containsExactly(vararg elements: Any?)

Asserts the list contains exactly the expected elements. They must be in the same order and there must not be any extra elements.

fun Assert<Sequence<*>>.containsExactly(vararg elements: Any?)

Asserts the sequence contains exactly the expected elements. They must be in the same order and there must not be any extra elements.

Link copied to clipboard
fun Assert<Iterable<*>>.containsExactlyInAnyOrder(vararg elements: Any?)

Asserts the iterable contains exactly the expected elements, in any order. Each value in expected must correspond to a matching value in actual, and visa-versa.

fun Assert<Sequence<*>>.containsExactlyInAnyOrder(vararg elements: Any?)

Asserts the sequence contains exactly the expected elements, in any order. Each value in expected must correspond to a matching value in actual, and visa-versa.

Link copied to clipboard

Asserts the char sequence contains a match of the regular expression.

Link copied to clipboard
fun Assert<Array<*>>.containsNone(vararg elements: Any?)

Asserts the collection does not contain any of the expected elements.

fun Assert<Iterable<*>>.containsNone(vararg elements: Any?)

Asserts the iterable does not contain any of the expected elements.

fun <K, V> Assert<Map<K, V>>.containsNone(vararg elements: Pair<K, V>)

Asserts the map does not contain any of the expected elements.

fun Assert<Sequence<*>>.containsNone(vararg elements: Any?)

Asserts the sequence does not contain any of the expected elements.

Link copied to clipboard
fun Assert<Array<*>>.containsOnly(vararg elements: Any?)

Asserts the array contains only the expected elements, in any order.

fun Assert<Iterable<*>>.containsOnly(vararg elements: Any?)

Asserts the iterable contains only the expected elements, in any order. Duplicate values in the expected and actual are ignored.

fun <K, V> Assert<Map<K, V>>.containsOnly(vararg elements: Pair<K, V>)

Asserts the map contains only the expected elements. There must not be any extra elements.

fun Assert<Sequence<*>>.containsOnly(vararg elements: Any?)

Asserts the sequence contains only the expected elements, in any order. Duplicate values in the expected and actual are ignored.

Link copied to clipboard
fun Assert<List<*>>.containsSubList(sublist: List<*>)

Asserts that a collection contains a subset of items the same order, but may have other items in the list.

Link copied to clipboard
fun <T, E> Assert<T>.corresponds(expected: E, correspondence: (T, E) -> Boolean)

Asserts the value corresponds to the expected one using the given correspondence function to compare them. This is useful when the objects don't have an equals implementation.

Link copied to clipboard
fun Assert<Array<*>>.doesNotContain(element: Any?)

Asserts the array does not contain the expected element, using !in.

fun Assert<Iterable<*>>.doesNotContain(element: Any?)

Asserts the iterable does not contain the expected element, using !in.

fun <K, V> Assert<Map<K, V>>.doesNotContain(element: Pair<K, V>)
fun <K, V> Assert<Map<K, V>>.doesNotContain(key: K, value: V)

Asserts the map does not contain the expected key-value pair.

fun Assert<Sequence<*>>.doesNotContain(element: Any?)

Asserts the sequence does not contain the expected element, using !n.

fun Assert<CharSequence>.doesNotContain(vararg expected: CharSequence, ignoreCase: Boolean = false)

Asserts the char sequence does not contain the specified char sequence(s).

fun Assert<CharSequence>.doesNotContain(expected: CharSequence, ignoreCase: Boolean = false)

Asserts the char sequence does not contain the specified char sequence.

fun Assert<CharSequence>.doesNotContain(expected: Iterable<CharSequence>, ignoreCase: Boolean = false)

Asserts the char sequence does not contain the specified char sequences.

Link copied to clipboard
fun <K, V> Assert<Map<K, V>>.doesNotContainKey(key: K)

Asserts the map does not contain the expected key.

Link copied to clipboard
fun <T, E> Assert<T>.doesNotCorrespond(expected: E, correspondence: (T, E) -> Boolean)

Asserts the value does not correspond to the expected one using the given correspondence function to compare them. This is useful when the objects don't have an equals implementation.

Link copied to clipboard
inline fun <T : Any> Assert<Any>.doesNotHaveClass()

Asserts the value does not have the expected kotlin class. This is an exact match, so assertThat("test").doesNotHaveClass<String>() fails but assertThat("test").doesNotHaveClass<Any>() is successful.

fun <T : Any> Assert<T>.doesNotHaveClass(kclass: KClass<out T>)

Asserts the value does not have the expected kotlin class. This is an exact match, so assertThat("test").doesNotHaveClass(String::class) fails but assertThat("test").doesNotHaveClass(Any::class) is successful.

fun <T : Any> Assert<T>.doesNotHaveClass(jclass: Class<out T>)

Asserts the value does not have the expected java class. This is an exact match, so assertThat("test").doesNotHaveClass(String::class.java) is fails but assertThat("test").doesNotHaveClass(Any::class.java) is successful.

Link copied to clipboard
fun <T> Assert<Array<T>>.each(f: (Assert<T>) -> Unit)

Asserts on each item in the array. The given lambda will be run for each item.

fun <E> Assert<Iterable<E>>.each(f: (Assert<E>) -> Unit)

Asserts on each item in the iterable. The given lambda will be run for each item.

fun <E> Assert<Sequence<E>>.each(f: (Assert<E>) -> Unit)

Asserts on each item in the sequence. The given lambda will be run for each item.

Link copied to clipboard
fun Assert<List<*>>.endsWith(vararg elements: Any?)

Asserts the list ends with the expected elements, in the same order.

fun Assert<CharSequence>.endsWith(other: CharSequence, ignoreCase: Boolean = false)

Asserts the char sequence ends with the expected char sequence.

Link copied to clipboard
fun <E, T : Iterable<E>> Assert<T>.exactly(times: Int, f: (Assert<E>) -> Unit)

Asserts on each item in the iterable, passing if exactly times items pass. The given lambda will be run for each item.

fun <E, T : Sequence<E>> Assert<T>.exactly(times: Int, f: (Assert<E>) -> Unit)

Asserts on each item in the sequence, passing if exactly times items pass. The given lambda will be run for each item.

Link copied to clipboard

Asserts the file exists.

fun Assert<Path>.exists(vararg options: LinkOption)

Assert that the path exists.

Link copied to clipboard

Returns an assert on the file's extension.

Link copied to clipboard
fun <E, R> Assert<Array<E>>.extracting(f1: (E) -> R): Assert<List<R>>

Extracts a value of from each item in the array, allowing you to assert on a list of those values.

fun <E, R> Assert<Iterable<E>>.extracting(f1: (E) -> R): Assert<List<R>>

Extracts a value of from each item in the iterable, allowing you to assert on a list of those values.

fun <E, R> Assert<Sequence<E>>.extracting(f1: (E) -> R): Assert<Sequence<R>>

Extracts a value of from each item in the sequence, allowing you to assert on a list of those values.

fun <E, R1, R2> Assert<Array<E>>.extracting(f1: (E) -> R1, f2: (E) -> R2): Assert<List<Pair<R1, R2>>>

Extracts two values of from each item in the array, allowing you to assert on a list of paris of those values.

fun <E, R1, R2> Assert<Iterable<E>>.extracting(f1: (E) -> R1, f2: (E) -> R2): Assert<List<Pair<R1, R2>>>

Extracts two values of from each item in the iterable, allowing you to assert on a list of paris of those values.

fun <E, R1, R2> Assert<Sequence<E>>.extracting(f1: (E) -> R1, f2: (E) -> R2): Assert<Sequence<Pair<R1, R2>>>

Extracts two values of from each item in the sequence, allowing you to assert on a list of paris of those values.

fun <E, R1, R2, R3> Assert<Array<E>>.extracting(f1: (E) -> R1, f2: (E) -> R2, f3: (E) -> R3): Assert<List<Triple<R1, R2, R3>>>

Extracts three values from each item in the array, allowing you to assert on a list of triples of those values.

fun <E, R1, R2, R3> Assert<Iterable<E>>.extracting(f1: (E) -> R1, f2: (E) -> R2, f3: (E) -> R3): Assert<List<Triple<R1, R2, R3>>>

Extracts three values from each item in the iterable, allowing you to assert on a list of triples of those values.

fun <E, R1, R2, R3> Assert<Sequence<E>>.extracting(f1: (E) -> R1, f2: (E) -> R2, f3: (E) -> R3): Assert<Sequence<Triple<R1, R2, R3>>>

Extracts three values from each item in the sequence, allowing you to assert on a list of triples of those values.

Link copied to clipboard
fun <E, T : Iterable<E>> Assert<T>.first(): Assert<E>

Asserts the iterable is not empty, and returns an assert on the first element.

Link copied to clipboard

Asserts the throwable is similar to the expected cause, checking the type and message.

Link copied to clipboard
inline fun <T : Any> Assert<Any>.hasClass()

Asserts the value has the expected kotlin class. This is an exact match, so assertThat("test").hasClass<String>() is successful but assertThat("test").hasClass<Any>() fails.

fun <T : Any> Assert<T>.hasClass(kclass: KClass<out T>)

Asserts the value has the expected kotlin class. This is an exact match, so assertThat("test").hasClass(String::class) is successful but assertThat("test").hasClass(Any::class) fails.

fun <T : Any> Assert<T>.hasClass(jclass: Class<out T>)

Asserts the value has the expected java class. This is an exact match, so assertThat("test").hasClass(String::class.java) is successful but assertThat("test").hasClass(Any::class.java) fails.

Link copied to clipboard
fun Assert<File>.hasDirectChild(expected: File)

Asserts the file has the expected direct child.

Link copied to clipboard
fun Assert<File>.hasExtension(expected: String)

Asserts the file has the expected extension.

Link copied to clipboard
fun Assert<Any>.hasHashCode(hashCode: Int)

Asserts the value has the expected hash code from it's hashCode.

Link copied to clipboard

Returns an assert on the hasCode method of the value.

Link copied to clipboard

Asserts the char sequence has the expected length.

Link copied to clipboard

Asserts the char sequence has the expected number of lines.

Link copied to clipboard

Asserts the throwable has the expected message.

Link copied to clipboard
fun Assert<File>.hasName(expected: String)

Asserts the file has the expected name.

Link copied to clipboard

Asserts the throwable has no cause.

Link copied to clipboard

Asserts that the actual stream has a different content as the expected stream. Both InputStreams will be closed by the assertion.

Link copied to clipboard
fun Assert<File>.hasParent(expected: String)

Asserts the file has the expected parent path.

Link copied to clipboard
fun Assert<File>.hasPath(expected: String)

Asserts the file has the expected path.

Link copied to clipboard

Asserts the throwable is similar to the expected root cause, checking the type and message.

Link copied to clipboard

Asserts that the actual stream has the same content as the expected stream. Both InputStreams will be closed by the assertion.

Link copied to clipboard

Asserts the char sequence has the same length as the expected one.

Link copied to clipboard
fun Assert<Array<*>>.hasSameSizeAs(other: Array<*>)

Asserts the array has the same size as the expected array.

Asserts the collection has the same size as the expected collection.

fun Assert<Map<*, *>>.hasSameSizeAs(other: Map<*, *>)

Asserts the map has the same size as the expected map.

Link copied to clipboard
fun Assert<Array<*>>.hasSize(size: Int)

Asserts the array has the expected size.

fun Assert<Collection<*>>.hasSize(size: Int)
fun Assert<Map<*, *>>.hasSize(size: Int)

Asserts the collection has the expected size.

Link copied to clipboard
fun Assert<File>.hasText(expected: String, charset: Charset = Charsets.UTF_8)

Asserts the file contains exactly the expected text (and nothing else).

Link copied to clipboard
fun Assert<Any?>.hasToString(string: String)

Asserts the value has the expected string from it's toString.

Link copied to clipboard
fun <T> Assert<Optional<T>>.hasValue(expected: T)

Asserts the optional has the expected value.

Link copied to clipboard
fun <T> Assert<Array<T>>.index(index: Int): Assert<T>

Returns an assert that assertion on the value at the given index in the array.

fun <T> Assert<List<T>>.index(index: Int): Assert<T>

Returns an assert that assertion on the value at the given index in the list.

Link copied to clipboard
fun <A, B : Comparable<A>> Assert<B>.isBetween(start: A, end: A)

Asserts the value is between the expected start and end values, inclusive.

Link copied to clipboard
fun Assert<Double>.isCloseTo(value: Double, delta: Double)
fun Assert<Float>.isCloseTo(value: Float, delta: Float)

Asserts the value if it is close to the expected value with given delta.

Link copied to clipboard
fun <T : Any> Assert<T>.isDataClassEqualTo(expected: T)

Like isEqualTo but reports exactly which properties differ. Only supports data classes. Note: you should not use this if your data class has a custom Any.equals since it can be misleading.

Link copied to clipboard

Asserts the file is a directory.

fun Assert<Path>.isDirectory(vararg options: LinkOption)

Assert that the path is a directory.

Link copied to clipboard
fun Assert<Array<*>>.isEmpty()

Asserts the array is empty.

Asserts the char sequence is empty.

fun Assert<Map<*, *>>.isEmpty()

Asserts the collection is empty.

Asserts the iterable is empty.

Asserts the sequence is empty.

Asserts optional's value is not present.

Link copied to clipboard
fun <T : Comparable<T>> Assert<T>.isEqualByComparingTo(expected: T)

Asserts that value is equal when comparing using {@link Comparable#compareTo(Object)}.

Asserts that actual.compareTo(BigDecimal(expected) == 0.

Link copied to clipboard
fun <T> Assert<T>.isEqualTo(expected: T)

Asserts the value is equal to the expected one, using ==.

fun <T> Assert<Array<T>>.isEqualTo(expected: Array<T>)

Asserts the array contents are equal to the expected one, using contentDeepEquals.

fun Assert<String?>.isEqualTo(other: String?, ignoreCase: Boolean = false)

Asserts the string is equal to the expected string.

Link copied to clipboard
fun <T : Any> Assert<T>.isEqualToIgnoringGivenProperties(other: T, vararg properties: KProperty1<T, Any?>)

Returns an assert that compares all accessible properties except the given properties on the calling class.

Link copied to clipboard
fun <T> Assert<T>.isEqualToWithGivenProperties(other: T, vararg properties: KProperty1<T, Any?>)

Returns an assert that compares only the given properties on the calling class

Link copied to clipboard

Assert that the path is an executable.

Link copied to clipboard

Asserts the given Result threw an exception, returning that exception if it was or failing it if didn't.

Link copied to clipboard

Asserts the boolean is false.

Link copied to clipboard

Asserts the file is a simple file (not a directory).

Link copied to clipboard
fun <A, B : Comparable<A>> Assert<B>.isGreaterThan(other: A)

Asserts the value is greater than the expected value, using >.

Link copied to clipboard

Asserts the value is greater or equal to the expected value, using >=.

Link copied to clipboard

Asserts the file is hidden.

Assert that the path is hidden.

Link copied to clipboard
fun <T> Assert<T>.isIn(vararg values: T)

Asserts the value is in the expected values, using in.

Link copied to clipboard
inline fun <T : Any> Assert<Any>.isInstanceOf(): Assert<T>

Asserts the value is an instance of the expected kotlin class. Both assertThat("test").isInstanceOf<String>() and assertThat("test").isInstanceOf<Any>() are successful.

fun <T : Any> Assert<Any>.isInstanceOf(kclass: KClass<T>): Assert<T>

Asserts the value is an instance of the expected kotlin class. Both assertThat("test").isInstanceOf(String::class) and assertThat("test").isInstanceOf(Any::class) are successful.

fun <T : Any, S : T> Assert<T>.isInstanceOf(jclass: Class<S>): Assert<S>

Asserts the value is an instance of the expected java class. Both assertThat("test").isInstanceOf(String::class.java) and assertThat("test").isInstanceOf(Any::class.java) is successful.

Link copied to clipboard
fun <A, B : Comparable<A>> Assert<B>.isLessThan(other: A)

Asserts the value is less than the expected value, using <.

Link copied to clipboard

Asserts the value is less than or equal to the expected value, using <=.

Link copied to clipboard

Asserts the number is less than 0.

Link copied to clipboard

Asserts the array is not empty.

Asserts the char sequence is not empty.

fun Assert<Map<*, *>>.isNotEmpty()

Asserts the collection is not empty.

Asserts the iterable is not empty.

Asserts the sequence is not empty.

Link copied to clipboard
fun Assert<Any?>.isNotEqualTo(expected: Any?)

Asserts the value is not equal to the expected one, using !=.

fun <T> Assert<Array<T>>.isNotEqualTo(expected: Array<T>)

Asserts the array contents are not equal to the expected one, using contentDeepEquals.

fun Assert<String?>.isNotEqualTo(other: String?, ignoreCase: Boolean = false)

Asserts the string is not equal to the expected string.

Link copied to clipboard

Asserts the file is not hidden.

Link copied to clipboard
fun <T> Assert<T>.isNotIn(vararg values: T)

Asserts the value is not in the expected values, using !in.

Link copied to clipboard
inline fun <T : Any> Assert<Any>.isNotInstanceOf()

Asserts the value is not an instance of the expected kotlin class. Both assertThat("test").isNotInstanceOf<String>() and assertThat("test").isNotInstanceOf<String>() fail.

fun <T : Any> Assert<T>.isNotInstanceOf(kclass: KClass<out T>)

Asserts the value is not an instance of the expected kotlin class. Both assertThat("test").isNotInstanceOf(String::class) and assertThat("test").isNotInstanceOf(Any::class) fail.

fun <T : Any> Assert<T>.isNotInstanceOf(jclass: Class<out T>)

Asserts the value is not an instance of the expected java class. Both assertThat("test").isNotInstanceOf(String::class) and assertThat("test").isNotInstanceOf(Any::class) fails.

Link copied to clipboard
fun <T : Any> Assert<T?>.isNotNull(): Assert<T>

Asserts the value is not null. You can pass in an optional lambda to run additional assertions on the non-null value.

Link copied to clipboard
fun Assert<Any?>.isNotSameAs(expected: Any?)

Asserts the value is not the same as the expected one, using !==.

Link copied to clipboard
fun Assert<Any?>.isNotSameInstanceAs(expected: Any?)

Asserts the value is not the same as the expected one, using !==.

Link copied to clipboard

Asserts the number is not 0.

Link copied to clipboard
fun Assert<Any?>.isNull()

Asserts the value is null.

Link copied to clipboard

Asserts the array is null or empty.

Asserts the char sequence is null or empty.

fun Assert<Map<*, *>?>.isNullOrEmpty()

Asserts the collection is null or empty.

Link copied to clipboard

Asserts the number is greater than 0.

Link copied to clipboard

Asserts that optional's value is present

Link copied to clipboard

Assert that the path is readable.

Link copied to clipboard
fun Assert<Path>.isRegularFile(vararg options: LinkOption)

Assert that the path is a regular file.

Link copied to clipboard
fun <T> Assert<T>.isSameAs(expected: T)

Asserts the value is the same as the expected one, using ===.

Link copied to clipboard
fun Assert<Path>.isSameFileAs(expected: Path)

Assert that the path points to the same object as the other path.

Link copied to clipboard
fun <T> Assert<T>.isSameInstanceAs(expected: T)

Asserts the value is the same as the expected one, using ===.

Link copied to clipboard
fun <A, B : Comparable<A>> Assert<B>.isStrictlyBetween(start: A, end: A)

Asserts the value is between the expected start and end values, non-inclusive.

Link copied to clipboard

Asserts the given Result successful returned a value, returning its result if it did or failing if it didn't.

Link copied to clipboard

Assert that the path is a symbolic link.

Link copied to clipboard

Asserts the boolean is true.

Link copied to clipboard

Assert that the path is writable link.

Link copied to clipboard

Asserts the number is 0.

Link copied to clipboard
fun <T : Any> Assert<T>.jClass(): Assert<Class<out T>>

Returns an assert on the java class of the value.

Link copied to clipboard

Returns an assert on the kotlin class of the value.

Link copied to clipboard
fun <K, V> Assert<Map<K, V>>.key(key: K): Assert<V>

Returns an assert that asserts on the value at the given key in the map.

Link copied to clipboard

Returns an assert on the CharSequence's length.

Link copied to clipboard
fun Assert<Path>.lines(charset: Charset = Charsets.UTF_8): Assert<List<String>>

Assert on file lines

Link copied to clipboard

Asserts the char sequence matches the expected regular expression.

Link copied to clipboard

Asserts if the values satisfies the predicate provided.

Link copied to clipboard

Returns an assert on the throwable's message.

Link copied to clipboard

Asserts the throwable contains the expected text

Link copied to clipboard

Returns an assert on the file's name.

Link copied to clipboard
fun <E> Assert<Iterable<E>>.none(f: (Assert<E>) -> Unit)

Asserts on each item in the iterable, passing if none of the items pass. The given lambda will be run for each item.

fun <E> Assert<Sequence<E>>.none(f: (Assert<E>) -> Unit)

Asserts on each item in the sequence, passing if none of the items pass. The given lambda will be run for each item.

Link copied to clipboard

Returns an assert on the file's parent.

Link copied to clipboard

Returns an assert on the file's path.

Link copied to clipboard
fun <T, R, F : (T) -> R, KCallable<R>> Assert<T>.prop(callable: F): Assert<R>

Returns an assert that asserts on the result of calling the given function.

fun <T, P> Assert<T>.prop(property: KProperty1<T, P>): Assert<P>

Returns an assert that asserts on the given property.

fun <T, P> Assert<T>.prop(name: String, extract: (T) -> P): Assert<P>

Returns an assert that asserts on the given property of the value.

Link copied to clipboard

Returns an assert on the throwable's root cause.

Link copied to clipboard
fun <E, T : Iterable<E>> Assert<T>.single(): Assert<E>

Asserts the iterable contains exactly one element, and returns an assert on that element.

Link copied to clipboard
fun Assert<Array<*>>.size(): Assert<Int>

Returns an assert on the Arrays's size.

Returns an assert on the Collection's size.

fun Assert<Map<*, *>>.size(): Assert<Int>

Returns an assert on the Maps's size.

Link copied to clipboard

Returns an assert on the throwable's stack trace.

Link copied to clipboard
fun Assert<List<*>>.startsWith(vararg elements: Any?)

Asserts the list starts with the expected elements, in the same order.

fun Assert<CharSequence>.startsWith(other: CharSequence, ignoreCase: Boolean = false)

Asserts the char sequence starts with the expected char sequence.

Link copied to clipboard
fun Assert<File>.text(charset: Charset = Charsets.UTF_8): Assert<String>

Returns an assert on the file's contents as text.

Link copied to clipboard

Returns an assert on the toString method of the value.