Add PromiseKit dependency
- Added PromiseKit dependency
This commit is contained in:
31
Carthage/Checkouts/PromiseKit/Tests/A+/2.3.1.swift
vendored
Normal file
31
Carthage/Checkouts/PromiseKit/Tests/A+/2.3.1.swift
vendored
Normal 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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user