     func testImediate() {
         let future = Future<Bool>()
         let expectation = expectationWithDescription("Imediate future failure")
-        future.failure(self.error)
+        future.failure(TestFailure.error)
         future.onSuccess {value in
             XCTAssert(false, "onSuccess called")
         }

import XCTest
import SimpleFutures

class FuturesSuccessTests: XCTestCase {
    
    override func setUp() {

    
    func testImmediateAndDelayed() {
        let future = Future<Bool>()
        let expectationImmediate = expectationWithDescription("Immediate future success")
        let expectationDelayed = expectationWithDescription("Delayed future success")
        future.onSuccess {value in
            XCTAssert(false, "onSuccess called")
        }
        future.onFailure {error in
            XCTAssertEqual(error.code, 100, "\(error)")
            expectationImmediate.fulfill()
        }
        future.failure(TestFailure.error)
        future.onFailure {error in
            XCTAssertEqual(error.code, 100, "\(error)")
            expectationDelayed.fulfill()
        }
        waitForExpectationsWithTimeout(2) {error in
            XCTAssertNil(error, "\(error)")
