             let result = Result { expectedValue }
             let taskCalled = expectationWithDescription("Task was called")
             let promise = Promise<Int> { fulfill in
+                fulfill(result)
                 taskCalled.fulfill()
-                fulfill(result)
             }
 
             promise.call { result in


            let completionCalled = expectationWithDescription("Completion was called")
            promise.call { result in
                completionCalled.fulfill()
                TestHelpers.expectFailure(expectedError, result: result)
            }

            waitForExpectationsWithTimeout(1.0, handler: nil)


            let completionCalled = expectationWithDescription("Completion was called")
            promise.call { result in
                TestHelpers.expectFailure(expectedError, result: result)
                completionCalled.fulfill()
            }

            waitForExpectationsWithTimeout(1.0, handler: nil)
