XCTest Closure Based Expectations
XCTest provides a method to generate an expectation that will fulfil based on the result of an
NSPredicate
,expectation(for:, evaluatedWith:, handler:)
.Add to that the fact that
NSPredicate
can be initialized with a closure to evaluate, and now you have a recipe for a closure based expectation.