extension of XCTestCase to create XCTestExpectation which waits for the condition to be fulfilled.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
UnitTests
XCTestCaseExpectationWithCondition.xcodeproj
XCTestCaseExpectationWithCondition
README.md

README.md

XCTestCase+ExpectationWithCondition

extension of XCTestCase to create XCTestExpectation which waits for the condition to be fulfilled.

Usage

func testBlockOperation() {
    let queue = NSOperationQueue()
    let operation = NSBlockOperation(block: {
        NSThread.sleepForTimeInterval(1.0)
    })

    queue.addOperation(operation)

    expectationWithCondition(operation.finished)
    waitForExpectationsWithTimeout(10.0, handler: nil)
}