Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Commit

Permalink
WIP: trying to figure out what's going on on Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
zwaldowski committed Aug 22, 2016
1 parent 80a274c commit 050ad97
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ env:
global:
secure: cqco7locH7wY0iSSQTyvSUHmCRNsxrXSPi65HgVHLKhAfNrto/SYKw68PokkVdTLaJlzcglOMFFZnwHcX0ubSgaWt4xiGd3Kx9aFQC/uHc8Nt7w56sG8DlUG1C+5rlsiayNwlqXNZuQizrDeqTYtiECDavIlcFdwk4JknlOMKUc=
script:
- scan -s Deferred
- scan -s MobileDeferred --devices "iPhone 5s (8.4)", "iPhone 6s (9.3)"
- scan -s TVDeferred
- env NSUnbufferedIO=YES xcodebuild -scheme Deferred -project ./Deferred.xcodeproj -destination 'platform=OS X' build test
- env NSUnbufferedIO=YES xcodebuild -scheme MobileDeferred -project ./Deferred.xcodeproj -destination 'platform=iOS Simulator,name=iPhone 6' build test
- env NSUnbufferedIO=YES xcodebuild -scheme MobileDeferred -project ./Deferred.xcodeproj -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.4' build test
- env NSUnbufferedIO=YES xcodebuild -scheme TVDeferred -project ./Deferred.xcodeproj -destination 'platform=tvOS Simulator' build test
- carthage build --no-skip-current --configuration Debug
- pod lib lint --quick
after_success:
Expand Down
10 changes: 10 additions & 0 deletions Tests/TaskTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -268,24 +268,34 @@ class TaskCustomExecutorTests: CustomExecutorTestCase {
}

func testThatRecoverMapsFailures() {
print("1")
let beforeExpectation = expectationWithDescription("original task filled")
let beforeTask: Task<Int> = Task(error: Error.First)

let afterExpectation = expectationWithDescription("mapped filled with same error")
let afterTask: Task<Int> = beforeTask.recover(upon: executor) { _ in 42 }

print("2")
beforeTask.upon {
print("3")
XCTAssertEqual($0.error as? Error, .First)
beforeExpectation.fulfill()
}

afterTask.upon {
print("4")
XCTAssertEqual($0.value, 42)
afterExpectation.fulfill()
}


print("5")
waitForExpectationsWithTimeout(TestTimeout, handler: nil)

print("6")
assertExecutorCalled(1)

print("7")
}

}
Expand Down

0 comments on commit 050ad97

Please sign in to comment.