assertk.assertions / atLeast

atLeast

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

Platform and version requirements: Common

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

assert(listOf(-1, 1, 2) as Iterable<Int>).atLeast(2) { it -> it.isPositive() }