Add PromiseKit dependency
- Added PromiseKit dependency
This commit is contained in:
27
Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Tests/TestStoreKit.m
vendored
Normal file
27
Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Tests/TestStoreKit.m
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
@import PMKStoreKit;
|
||||
@import PromiseKit;
|
||||
@import StoreKit;
|
||||
@import XCTest;
|
||||
|
||||
@implementation PMKSKProductsRequest: SKProductsRequest
|
||||
|
||||
- (void)start {
|
||||
PMKAfter(0.5).then(^{
|
||||
[self.delegate productsRequest:self didReceiveResponse:[SKProductsResponse new]];
|
||||
});
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation SKProductsRequestTests: XCTestCase
|
||||
|
||||
- (void)test {
|
||||
id ex = [self expectationWithDescription:@""];
|
||||
SKProductsRequest *rq = [PMKSKProductsRequest new];
|
||||
[rq promise].then(^{
|
||||
[ex fulfill];
|
||||
});
|
||||
[self waitForExpectationsWithTimeout:1 handler:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
22
Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Tests/TestStoreKit.swift
vendored
Normal file
22
Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Tests/TestStoreKit.swift
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import PMKStoreKit
|
||||
import PromiseKit
|
||||
import StoreKit
|
||||
import XCTest
|
||||
|
||||
class SKProductsRequestTests: XCTestCase {
|
||||
func test() {
|
||||
class MockProductsRequest: SKProductsRequest {
|
||||
override func start() {
|
||||
after(seconds: 0.1).done {
|
||||
self.delegate?.productsRequest(self, didReceive: SKProductsResponse())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let ex = expectation(description: "")
|
||||
MockProductsRequest().start(.promise).done { _ in
|
||||
ex.fulfill()
|
||||
}
|
||||
waitForExpectations(timeout: 1, handler: nil)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user