Is there a way to assert that a collection contain...
# kotest
p
Is there a way to assert that a collection contains a single element that satisfies some assertions (rather than a predicate returning boolean?)
i.e. something like
Copy code
warnings.shouldHaveSingleElementSatisfying {
    message shouldContainIgnoringCase "cheese"
    code shouldBeGreaterThan 100            
}
s
myList.forOne { }
🙏 1
p
Thanks 🙂 Not sure how I missed that…