     - parameter timeout: The timeout, in seconds.
     - parameter conditionsCheck: A block that performs the condition check and returns true/false.
     */
-    public func waitForConditionsWithTimeout(timeout: NSTimeInterval, conditionsCheck: () -> Bool) {
+    public func waitForConditionsWithTimeout(timeout: NSTimeInterval, conditionsCheck: () -> Bool) throws {
         if isInUnitTest() {
             var condition = false
             let startTime = NSDate()

                condition = conditionsCheck()
                let currentTime = NSDate().timeIntervalSinceDate(startTime)
                if currentTime > timeout {
                    break
                }
            }
        } else {

    return false
}


private enum WaitConditionError: ErrorType {
    case Timeout
}

extension NSObject {
    /**
    Pumps the run loop while waiting for the given conditions check to return true, or the timeout has
