Add PromiseKit dependency

- Added PromiseKit dependency
This commit is contained in:
2018-11-15 22:08:00 -04:00
parent 2689d86c18
commit be7b6b5881
541 changed files with 46282 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import PromiseKit
import XCTest
class Test231: XCTestCase {
func test() {
describe("2.3.1: If `promise` and `x` refer to the same object, reject `promise` with a `TypeError' as the reason.") {
specify("via return from a fulfilled promise") { d, expectation in
var promise: Promise<Void>!
promise = Promise().then { () -> Promise<Void> in
return promise
}
promise.catch { err in
if case PMKError.returnedSelf = err {
expectation.fulfill()
}
}
}
specify("via return from a rejected promise") { d, expectation in
var promise: Promise<Void>!
promise = Promise<Void>(error: Error.dummy).recover { _ -> Promise<Void> in
return promise
}
promise.catch { err in
if case PMKError.returnedSelf = err {
expectation.fulfill()
}
}
}
}
}
}