strikt-core / strikt.assertions

Package strikt.assertions

Properties

cause

Maps an assertion on a Throwable to an assertion on its Throwable.cause.

val <T : Throwable> Builder<T>.cause: DescribeableBuilder<Throwable?>

childFiles

Maps this assertion to an assertion on the child files of the subject.

val <T : File> Builder<T>.childFiles: Builder<List<File>>

endInclusive

Maps an assertion on the ClosedRange to an assertion on its ClosedRange.endInclusive.

val <T : ClosedRange<E>, E> Builder<T>.endInclusive: Builder<E>

extension

Maps this assertion to an assertion on the file extension (not including the dot) or empty string if it not have one.

val <T : File> Builder<T>.extension: Builder<String>

fileName

Maps this assertion to an assertion on the path representing the name of the subject.

val <T : Path> Builder<T>.fileName: Builder<Path>

first

Maps an assertion on a Pair to an assertion on its Pair.first property.

val <A, B> Builder<Pair<A, B>>.first: Builder<A>

Maps an assertion on a Triple to an assertion on its Triple.first property.

val <A, B, C> Builder<Triple<A, B, C>>.first: Builder<A>

lastModified

Maps this assertion to an assertion on the last modified of the subject.

val <T : File> Builder<T>.lastModified: Builder<Long>

length

Maps an assertion on a CharSequence to an assertion on its length.

val <T : CharSequence> Builder<T>.length: Builder<Int>

message

Maps an assertion on a Throwable to an assertion on its Throwable.message. This mapping also asserts that the message is not null.

val <T : Throwable> Builder<T>.message: Builder<String?>

name

Maps an assertion on an enum to an assertion on its name.

val <T : Enum<T>> Builder<T>.name: Builder<String>

nameWithoutExtension

Maps this assertion to an assertion on the file name without the extension.

val <T : File> Builder<T>.nameWithoutExtension: Builder<String>

ordinal

Maps an assertion on an enum to an assertion on its ordinal.

val <T : Enum<T>> Builder<T>.ordinal: Builder<Int>

parent

Maps this assertion to an assertion on the parent file or null if the subject does not have a parent.

val <T : File> Builder<T>.parent: Builder<String?>

parentFile

Maps this assertion to an assertion on the parent file or null if the subject does not have a parent.

val <T : File> Builder<T>.parentFile: Builder<File?>

second

Maps an assertion on a Pair to an assertion on its Pair.second property.

val <A, B> Builder<Pair<A, B>>.second: Builder<B>

Maps an assertion on a Triple to an assertion on its Triple.second property.

val <A, B, C> Builder<Triple<A, B, C>>.second: Builder<B>

size

Maps an assertion on a collection to an assertion on its size.

val <T : Collection<*>> Builder<T>.size: Builder<Int>

start

Maps an assertion on the ClosedRange to an assertion on its ClosedRange.start.

val <T : ClosedRange<E>, E> Builder<T>.start: Builder<E>

third

Maps an assertion on a Triple to an assertion on its Triple.third property.

val <A, B, C> Builder<Triple<A, B, C>>.third: Builder<C>

Functions

all

Asserts that all elements of the subject pass the assertions in predicate.

infix fun <T : Iterable<E>, E> Builder<T>.all(predicate: Builder<E>.() -> Unit): Builder<T>

allBytes

Maps this assertion to an assertion over all bytes of this subject path .

fun <T : Path> Builder<T>.allBytes(): Builder<ByteArray>

allIndexed

Asserts that all elements of the subject pass the assertions in predicate.

infix fun <T : Iterable<E>, E> Builder<T>.allIndexed(predicate: Builder<E>.(Int) -> Unit): Builder<T>

allLines

Maps this assertion to an assertion over all lines of this subject path decoded using the provided charset.

fun <T : Path> Builder<T>.allLines(charset: Charset = Charsets.UTF_8): Builder<List<String>>

any

Asserts that at least one element of the subject pass the assertions in predicate.

infix fun <T : Iterable<E>, E> Builder<T>.any(predicate: Builder<E>.() -> Unit): Builder<T>

anyIndexed

Asserts that at least one element of the subject pass the assertions in predicate.

infix fun <T : Iterable<E>, E> Builder<T>.anyIndexed(predicate: Builder<E>.(Int) -> Unit): Builder<T>

atLeast

Asserts that at least count elements of the subject pass the assertions in predicate.

fun <T : Iterable<E>, E> Builder<T>.atLeast(count: Int, predicate: Builder<E>.() -> Unit): Builder<T>

atMost

Asserts that at most count elements of the subject pass the assertions in predicate.

fun <T : Iterable<E>, E> Builder<T>.atMost(count: Int, predicate: Builder<E>.() -> Unit): Builder<T>

childFile

Maps this assertion to an assertion on a specific child name of the subject.

fun <T : File> Builder<T>.childFile(name: String): Builder<File>

contains

Asserts that the subject contains a match for the expected regular expression.

infix fun <T : CharSequence> Builder<T>.contains(expected: Regex): Builder<T>

Asserts that the subject contains the expected substring.

infix fun <T : CharSequence> Builder<T>.contains(expected: CharSequence): Builder<T>

Asserts that the subject range contains the provided element.

infix fun <T : ClosedRange<E>, E> Builder<T>.contains(element: E): Builder<T>

Asserts that all elements are present in the subject. The elements may exist in any order any number of times and the subject may contain further elements that were not specified. If either the subject or elements are empty the assertion always fails.

fun <T : Iterable<E>, E> Builder<T>.contains(vararg elements: E): Builder<T>
infix fun <T : Iterable<E>, E> Builder<T>.contains(elements: Collection<E>): Builder<T>

containsExactly

Asserts that all elements and no others are present in the subject in the specified order.

fun <T : Iterable<E>, E> Builder<T>.containsExactly(vararg elements: E): Builder<T>
infix fun <T : Iterable<E>, E> Builder<T>.containsExactly(elements: Collection<E>): Builder<T>

containsExactlyInAnyOrder

Asserts that all elements and no others are present in the subject. Order is not evaluated, so an assertion on a List will pass so long as it contains all the same elements with the same cardinality as elements regardless of what order they appear in.

fun <T : Iterable<E>, E> Builder<T>.containsExactlyInAnyOrder(vararg elements: E): Builder<T>
infix fun <T : Iterable<E>, E> Builder<T>.containsExactlyInAnyOrder(elements: Collection<E>): Builder<T>

containsIgnoringCase

Asserts that the subject contains a match for the expected regular expression regardless of case.

infix fun <T : CharSequence> Builder<T>.containsIgnoringCase(expected: Regex): Builder<T>

Asserts that the subject contains the expected substring regardless of case.

infix fun <T : CharSequence> Builder<T>.containsIgnoringCase(expected: CharSequence): Builder<T>

containsKey

Asserts that the subject map contains an entry indexed by key. Depending on the map implementation the value associated with key may be null. This assertion just tests for the existence of the key.

infix fun <T : Map<K, V>, K, V> Builder<T>.containsKey(key: K): Builder<T>

containsKeys

Asserts that the subject map contains entries for all keys.

fun <T : Map<K, V>, K, V> Builder<T>.containsKeys(vararg keys: K): Builder<T>

containsSequence

Asserts that all elements are present in the subject in exactly the same order

fun <T : List<E>, E> Builder<T>.containsSequence(vararg elements: E): Builder<T>
fun <T : List<E>, E> Builder<T>.containsSequence(elements: List<E>): Builder<T>

contentEquals

Asserts that the subject's content is equal to that of other according to Array.contentEquals.

infix fun <T> Builder<Array<out T>>.contentEquals(other: Array<out T>): Builder<Array<out T>>

Asserts that the subject's content is equal to that of other according to BooleanArray.contentEquals.

infix fun Builder<BooleanArray>.contentEquals(other: BooleanArray): Builder<BooleanArray>

Asserts that the subject's content is equal to that of other according to ByteArray.contentEquals.

infix fun Builder<ByteArray>.contentEquals(other: ByteArray): Builder<ByteArray>

Asserts that the subject's content is equal to that of other according to ShortArray.contentEquals.

infix fun Builder<ShortArray>.contentEquals(other: ShortArray): Builder<ShortArray>

Asserts that the subject's content is equal to that of other according to IntArray.contentEquals.

infix fun Builder<IntArray>.contentEquals(other: IntArray): Builder<IntArray>

Asserts that the subject's content is equal to that of other according to LongArray.contentEquals.

infix fun Builder<LongArray>.contentEquals(other: LongArray): Builder<LongArray>

Asserts that the subject's content is equal to that of other according to FloatArray.contentEquals.

infix fun Builder<FloatArray>.contentEquals(other: FloatArray): Builder<FloatArray>

Asserts that the subject's content is equal to that of other according to DoubleArray.contentEquals.

infix fun Builder<DoubleArray>.contentEquals(other: DoubleArray): Builder<DoubleArray>

Asserts that the subject's content is equal to that of other according to CharArray.contentEquals.

infix fun Builder<CharArray>.contentEquals(other: CharArray): Builder<CharArray>

count

Maps this assertion to an assertion over the count of elements in the subject.

fun Builder<out Iterable<*>>.count(): Builder<Int>

Maps this assertion to an assertion over the count of elements matching predicate.

fun <T : Iterable<E>, E> Builder<T>.count(description: String, predicate: (E) -> Boolean): Builder<Int>

doesNotContain

Asserts that none of elements are present in the subject.

fun <T : Iterable<E>, E> Builder<T>.doesNotContain(vararg elements: E): Builder<T>
infix fun <T : Iterable<E>, E> Builder<T>.doesNotContain(elements: Collection<E>): Builder<T>

doesNotThrow

Deprecated form of isSuccess().

fun <R : Any> Builder<Result<R>>.doesNotThrow(): Builder<R>

elementAt

Maps this assertion to an assertion over the indexed element in the subject iterable.

fun <T : Iterable<E>, E> Builder<T>.elementAt(index: Int): Builder<E>

endsWith

Asserts that the subject ends with the expected character.

infix fun <T : CharSequence> Builder<T>.endsWith(expected: Char): Builder<T>

Asserts that the subject ends with the expected string.

infix fun <T : CharSequence> Builder<T>.endsWith(expected: CharSequence): Builder<T>

Asserts that the subject end with the provided path.

infix fun <T : Path> Builder<T>.endsWith(other: Path): Builder<T>

Asserts that the subject end with the provided path string.

infix fun <T : Path> Builder<T>.endsWith(other: String): Builder<T>

exactly

Asserts that exactly count elements of the subject pass the assertions in predicate.

fun <T : Iterable<E>, E> Builder<T>.exactly(count: Int, predicate: Builder<E>.() -> Unit): Builder<T>

exists

Asserts that the file exists.

fun <T : File> Builder<T>.exists(): Builder<T>

Asserts that the subject exists, handling symbolic links according to the provided options

fun <T : Path> Builder<T>.exists(vararg options: LinkOption = emptyArray()): Builder<T>

failed

Asserts that the subject is a failed result and maps this assertion to an assertion over the exception that was thrown

fun <T> Builder<Result<T>>.failed(): Builder<Throwable>

failedWith

Asserts that the subject is a isFailure result that threw an exception assignable to E and maps this assertion to an assertion over that exception.

fun <E : Throwable> Builder<Result<*>>.failedWith(): Builder<E>

filter

Maps this assertion to an assertion over a list of all elements of the subject that match predicate.

infix fun <T : Iterable<E>, E> Builder<T>.filter(predicate: (E) -> Boolean): Builder<List<E>>

filterIsInstance

Maps this assertion to an assertion over a list of all elements of the subject that are instances of R.

fun <R> Builder<out Iterable<*>>.filterIsInstance(): Builder<List<R>>

filterNot

Maps this assertion to an assertion over a list of all elements of the subject that do not match predicate.

infix fun <T : Iterable<E>, E> Builder<T>.filterNot(predicate: (E) -> Boolean): Builder<List<E>>

first

Maps this assertion to an assertion over the first element in the subject iterable.

fun <T : Iterable<E>, E> Builder<T>.first(): Builder<E>

Maps this assertion to an assertion over the first element in the subject iterable that matches predicate.

infix fun <T : Iterable<E>, E> Builder<T>.first(predicate: (E) -> Boolean): Builder<E>

flatMap

Maps this assertion to an assertion over a flattened list of the results of transform for each element in the subject iterable.

infix fun <T : Iterable<E>, E, R> Builder<T>.flatMap(transform: (E) -> Iterable<R>): Builder<List<R>>

get

Maps this assertion to an assertion on the element at index i in the subject list.

operator fun <T : List<E>, E> Builder<T>.get(i: Int): Builder<E>

Maps this assertion to an assertion on the elements at the sub-list represented by range in the subject list.

operator fun <T : List<E>, E> Builder<T>.get(range: IntRange): Builder<List<E>>

Maps this assertion to an assertion on the value indexed by key in the subject list.

operator fun <T : Map<K, V>, K, V> Builder<T>.get(key: K): Builder<V?>

getValue

Asserts that key exists in the subject map and then maps this assertion to an assertion on the associated value.

infix fun <T : Map<K, V>, K, V> Builder<T>.getValue(key: K): Builder<V>

hasEntry

Asserts that the subject map contains an entry indexed by key with a value equal to value.

fun <T : Map<K, V>, K, V> Builder<T>.hasEntry(key: K, value: V): Builder<T>

hasLength

Asserts that the subject has a CharSequence.length of exactly expected.

infix fun <T : CharSequence> Builder<T>.hasLength(expected: Int): Builder<T>

hasSize

Asserts that the subject has a Collection.size of exactly expected.

infix fun <T : Collection<E>, E> Builder<T>.hasSize(expected: Int): Builder<T>

isA

Asserts that the subject is an instance of T.

fun <T> Builder<*>.isA(): Builder<T>

isAbsent

Asserts that an Optional does not contain a value.

fun <T> Builder<Optional<T>>.isAbsent(): Builder<Optional<T>>

isAbsolute

Asserts that the subject is an absolute path.

fun <T : Path> Builder<T>.isAbsolute(): Builder<T>

isBlank

Asserts that the subject is empty, or contains only whitespace characters.

fun <T : CharSequence> Builder<T>.isBlank(): Builder<T>

isDirectory

Asserts that the file is a directory.

fun <T : File> Builder<T>.isDirectory(): Builder<T>

Asserts that the subject is a directory, handling symbolic links according to the provided options.

fun <T : Path> Builder<T>.isDirectory(vararg options: LinkOption = emptyArray()): Builder<T>

isEmpty

Asserts that the subject's content is empty.

fun <T> Builder<Array<T>>.isEmpty(): Builder<Array<T>>
fun Builder<BooleanArray>.isEmpty(): Builder<BooleanArray>
fun Builder<ByteArray>.isEmpty(): Builder<ByteArray>
fun Builder<ShortArray>.isEmpty(): Builder<ShortArray>
fun Builder<IntArray>.isEmpty(): Builder<IntArray>
fun Builder<LongArray>.isEmpty(): Builder<LongArray>
fun Builder<FloatArray>.isEmpty(): Builder<FloatArray>
fun Builder<DoubleArray>.isEmpty(): Builder<DoubleArray>
fun Builder<CharArray>.isEmpty(): Builder<CharArray>

Asserts that the subject is the empty string.

fun <T : CharSequence> Builder<T>.isEmpty(): Builder<T>

isEqualTo

Asserts that the subject is equal to expected according to the standard Kotlin == operator.

infix fun <T> Builder<T>.isEqualTo(expected: T?): Builder<T>

Asserts that the subject is within tolerance of expected.

fun Builder<Double>.isEqualTo(expected: Double, tolerance: Double): Builder<Double>
fun Builder<Float>.isEqualTo(expected: Float, tolerance: Double): Builder<Float>

isEqualToIgnoringCase

Asserts that the subject is equal to the expected value regardless of case.

infix fun Builder<String>.isEqualToIgnoringCase(expected: String): Builder<String>

isExecutable

Asserts that the file is executable.

fun <T : File> Builder<T>.isExecutable(): Builder<T>

isFailure

Asserts that the result of an action did throw an exception and maps to an assertion on the exception. The assertion fails if the subject's Result.isFailure returns false.

fun <R> Builder<Result<R>>.isFailure(): Builder<Throwable>

isFalse

Asserts that the subject is not null and is the boolean value false.

fun <T : Boolean?> Builder<T>.isFalse(): Builder<T>

isGreaterThan

Asserts that the subject compares greater than expected according to Kotlin's standard > operator.

infix fun <T : Comparable<T>> Builder<T>.isGreaterThan(expected: T): Builder<T>

isGreaterThanOrEqualTo

Asserts that the subject compares greater than or equal to expected according to Kotlin's standard >= operator.

infix fun <T : Comparable<T>> Builder<T>.isGreaterThanOrEqualTo(expected: T): Builder<T>

isIn

Asserts that the subject is in the expected range.

infix fun <T : Comparable<T>> Builder<T>.isIn(expected: ClosedRange<T>): Builder<T>

isLessThan

Asserts that the subject compares less than expected according to Kotlin's standard < operator.

infix fun <T : Comparable<T>> Builder<T>.isLessThan(expected: T): Builder<T>

isLessThanOrEqualTo

Asserts that the subject compares less than or equal to expected according to Kotlin's standard <= operator.

infix fun <T : Comparable<T>> Builder<T>.isLessThanOrEqualTo(expected: T): Builder<T>

isLowerCase

Asserts that the subject is composed of all lower-case characters.

fun <T : CharSequence> Builder<T>.isLowerCase(): Builder<T>

isNotBlank

Asserts that the subject is not blank (contains at least one non-whitespace character).

fun <T : CharSequence> Builder<T>.isNotBlank(): Builder<T>

isNotDirectory

Asserts that the file is not a directory.

fun <T : File> Builder<T>.isNotDirectory(): Builder<T>

isNotEmpty

Asserts that the subject is not the empty string (contains at least one character).

fun <T : CharSequence> Builder<T>.isNotEmpty(): Builder<T>

isNotEqualTo

Asserts that the subject is not equal to expected according to the standard Kotlin == operator.

infix fun <T> Builder<T>.isNotEqualTo(expected: T?): Builder<T>

isNotExecutable

Asserts that the file is not executable.

fun <T : File> Builder<T>.isNotExecutable(): Builder<T>

isNotNull

Asserts that the subject is not null.

fun <T> Builder<T?>.isNotNull(): Builder<T>

isNotReadable

Asserts that the file is not readable.

fun <T : File> Builder<T>.isNotReadable(): Builder<T>

isNotRegularFile

Asserts that the file is not a regular file.

fun <T : File> Builder<T>.isNotRegularFile(): Builder<T>

isNotSameInstanceAs

Asserts that the subject is not the same instance as expected according to the standard Kotlin === operator.

infix fun <T> Builder<T>.isNotSameInstanceAs(expected: Any?): Builder<T>

isNotWritable

Asserts that the file is not writable.

fun <T : File> Builder<T>.isNotWritable(): Builder<T>

isNull

Asserts that the subject is null.

fun <T> Builder<T?>.isNull(): Builder<Nothing>

isNullOrBlank

Asserts that the subject is null, empty, or contains only whitespace characters.

fun <T : CharSequence?> Builder<T>.isNullOrBlank(): Builder<T>

isNullOrEmpty

Asserts that the subject is null or the empty string.

fun <T : CharSequence?> Builder<T>.isNullOrEmpty(): Builder<T>

isOneOf

Asserts that the subject is one of values.

fun <T : Enum<T>> Builder<T>.isOneOf(vararg values: T): Builder<T>

isPresent

Asserts that an Optional contains a value (is not empty) and returns an assertion builder whose subject is the value.

fun <T> Builder<Optional<T>>.isPresent(): Builder<T>

isReadable

Asserts that the file is readable.

fun <T : File> Builder<T>.isReadable(): Builder<T>

isRegularFile

Asserts that the file is a regular file.

fun <T : File> Builder<T>.isRegularFile(): Builder<T>

Asserts that the subject is a regular file, handling symbolic links according to the provided options.

fun <T : Path> Builder<T>.isRegularFile(vararg options: LinkOption = emptyArray()): Builder<T>

isSameInstanceAs

Asserts that the subject is the same instance as expected according to the standard Kotlin === operator.

infix fun <T> Builder<T>.isSameInstanceAs(expected: Any?): Builder<T>

isSorted

Asserts that the subject collection is sorted according to the Comparator. Empty collections are considered sorted.

infix fun <T : Collection<E>, E> Builder<T>.isSorted(comparator: Comparator<E>): Builder<T>

isSuccess

Asserts that the result of an action did not throw any exception and maps to an assertion on the result value. The assertion fails if the subject's Result.isSuccess returns false.

fun <R> Builder<Result<R>>.isSuccess(): Builder<R>

isSymbolicLink

Asserts that the subject is a symbolic link.

fun <T : Path> Builder<T>.isSymbolicLink(): Builder<T>

isTrue

Asserts that the subject is not null and is the boolean value true.

fun <T : Boolean?> Builder<T>.isTrue(): Builder<T>

isUpperCase

Asserts that the subject is composed of all upper-case characters.

fun <T : CharSequence> Builder<T>.isUpperCase(): Builder<T>

isWritable

Asserts that the file is writable.

fun <T : File> Builder<T>.isWritable(): Builder<T>

last

Maps this assertion to an assertion over the last element in the subject iterable.

fun <T : Iterable<E>, E> Builder<T>.last(): Builder<E>

lines

Maps this assertion to an assertion on the lines of the subject decoded using the provided charset.

fun <T : File> Builder<T>.lines(charset: Charset = Charsets.UTF_8): Builder<List<String>>

map

Applies Iterable.map with function to the subject and returns an assertion builder wrapping the result.

infix fun <T : Iterable<E>, E, R> Builder<T>.map(function: (E) -> R): Builder<Iterable<R>>

matches

Asserts that the subject is a full match for the expected regular expression.

infix fun <T : CharSequence> Builder<T>.matches(expected: Regex): Builder<T>

matchesIgnoringCase

Asserts that the subject is a full match for the expected regular expression regardless of case.

infix fun <T : CharSequence> Builder<T>.matchesIgnoringCase(expected: Regex): Builder<T>

none

Asserts that no elements of the subject pass the assertions in predicate.

infix fun <T : Iterable<E>, E> Builder<T>.none(predicate: Builder<E>.() -> Unit): Builder<T>

noneIndexed

Asserts that no elements of the subject pass the assertions in predicate.

infix fun <T : Iterable<E>, E> Builder<T>.noneIndexed(predicate: Builder<E>.(Int) -> Unit): Builder<T>

notExists

Asserts that the file not exists.

fun <T : File> Builder<T>.notExists(): Builder<T>

one

Asserts that exactly one element of the subject passes the assertions in predicate.

infix fun <T : Iterable<E>, E> Builder<T>.one(predicate: Builder<E>.() -> Unit): Builder<T>

propertiesAreEqualTo

Asserts that all properties of the subject match those of other according to either contentEquals in the case of array properties or isEqualTo in other cases.

infix fun <T : Any> Builder<T>.propertiesAreEqualTo(other: T): Builder<T>

resolve

Maps this assertion to an assertion of this subject resolved with the provided path.

infix fun <T : Path> Builder<T>.resolve(other: Path): Builder<Path>
infix fun <T : Path> Builder<T>.resolve(other: String): Builder<Path>

single

Maps this assertion to an assertion over the single element in the subject iterable.

fun <T : Collection<E>, E> Builder<T>.single(): Builder<E>

startsWith

Asserts that the subject starts with the expected character.

infix fun <T : CharSequence> Builder<T>.startsWith(expected: Char): Builder<T>

Asserts that the subject starts with the expected string.

infix fun <T : CharSequence> Builder<T>.startsWith(expected: CharSequence): Builder<T>

Asserts that the subject starts with the provided path.

infix fun <T : Path> Builder<T>.startsWith(other: Path): Builder<T>
infix fun <T : Path> Builder<T>.startsWith(other: String): Builder<T>

succeeded

Asserts that the subject is a successful result and maps this assertion to an assertion over the result value.

fun <T> Builder<Result<T>>.succeeded(): Builder<T>

text

Maps this assertion to an assertion on the complete text of the subject decoded using the provided charset.

fun <T : File> Builder<T>.text(charset: Charset = Charsets.UTF_8): Builder<String>

toFile

Maps this assertion to an assertion on the file object representing this subject.

fun <T : Path> Builder<T>.toFile(): Builder<File>

toList

Maps an array to a list to make it possible to use the iterable matchers

fun <T> Builder<Array<T>>.toList(): Builder<List<T>>

toNullable

Maps an assertion on a Java Optional to a Kotlin nullable type.

fun <T> Builder<Optional<T>>.toNullable(): Builder<T?>

toPath

Maps this assertion to an assertion on a path object representing this subject.

fun <T : File> Builder<T>.toPath(): Builder<Path>

trim

Trims the subject CharSequence.

fun <T : CharSequence> Builder<T>.trim(): Builder<CharSequence>

Trims the subject string.

fun Builder<String>.trim(): Builder<String>

withElementAt

Runs a group of assertions on the element at index in the subject iterable.

fun <T : Iterable<E>, E> Builder<T>.withElementAt(index: Int, block: Builder<E>.() -> Unit): Builder<T>

withFirst

Runs a group of assertions on the first element in the subject iterable.

fun <T : Iterable<E>, E> Builder<T>.withFirst(block: Builder<E>.() -> Unit): Builder<T>

Runs a group of assertions on the first element in the subject iterable that matches predicate.

fun <T : Iterable<E>, E> Builder<T>.withFirst(predicate: (E) -> Boolean, block: Builder<E>.() -> Unit): Builder<T>

withLast

Runs a group of assertions on the last element in the subject iterable.

fun <T : Iterable<E>, E> Builder<T>.withLast(block: Builder<E>.() -> Unit): Builder<T>

withValue

Runs a group of assertions on the first element in the subject iterable.

fun <T : Map<K, V>, K, V> Builder<T>.withValue(key: K, block: Builder<V>.() -> Unit): Builder<T>