 
         let promise = Promise<Int>()
 
-        promise.reject(NSError(domain: "", code: -1, userInfo: nil))
+        promise.reject(self.generateRandomError())
 
         promise
             .then({ (value) -> Promise<Int> in

            })

        dispatch_async(dispatch_get_main_queue()) {
            promise.reject(NSError(domain: "", code: -1, userInfo: nil))
        }

        self.waitForExpectationsWithTimeout(1.0, handler: nil)


    func testPropagateNSError() {
        let expectation = self.expectationWithDescription("wait")

        let error   = self.generateRandomError()
        let promise = Promise<Int>()

        promise
            .then({ (i) throws -> Void in
                throw error
            })
            .then(nil, { (e: NSError) in
                XCTAssertEqual(e, error)
                expectation.fulfill()
            })

