 
     func testPropagateSwiftErrorType() {
         let expectation = self.expectationWithDescription("wait")
-        let promise = Promise<Int>()
-
-        promise
+        let deferred = Promise<Int>.deferred()
+
+        deferred.promise
             .then({ (i) throws -> Void in
                 throw SomeError.IntError(i)
             })

                XCTFail()
            })

        for promise in promises {
            promise.fulfill(1)
        }

        self.waitForExpectationsWithTimeout(3.0, handler: nil)

                expectation.fulfill()
            })

        deferred.fulfill(1000)
        self.waitForExpectationsWithTimeout(1.0, handler: nil)
    }
}
