A short & sweet expectation implementation written in Swift. See the blog post for the rationale behind it.
This is similar to using an XCTestExpectation.
Simply create an expectation, pass it to an asynchronous task and wait on it.
let expectation = Expectation()
someAsynchronousMethodCall() {
expectation.fulfill()
}
expectation.wait(for: 5)
It's just a single file, copy it to your project and you're done.