Skip to content

Commit 9e9acb6

Browse files
committed
Add travis spec
1 parent a3d00c4 commit 9e9acb6

File tree

2 files changed

+8
-46
lines changed

2 files changed

+8
-46
lines changed

.travis.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: swift
2+
osx_image: xcode10.2
3+
before_install:
4+
- gem install xcpretty
5+
- gem install cocoapods
6+
script:
7+
- xcodebuild -scheme Future_iOS -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X' test
8+
- pod lib lint --allow-warnings

Tests/FutureResultTests.swift

-46
Original file line numberDiff line numberDiff line change
@@ -182,52 +182,6 @@ class FutureResultTests: XCTestCase {
182182
.run { resJ = $0 }
183183
XCTAssert(resJ.value == "4 - bar")
184184
}
185-
186-
// func testFoo() {
187-
//
188-
// struct User: Codable {
189-
// var id: String
190-
// var name: String
191-
// }
192-
// struct Food: Codable {
193-
// var type: String
194-
// var tastiness: Int
195-
// }
196-
//
197-
// let loadFileUser: FutureResult<User> = Future
198-
// .init(work: {
199-
// .success(User(id: "foo", name: "bar"))
200-
// })
201-
//
202-
// let loadStringFood: FutureResult<Food> = Future<String>
203-
// .init(value: #"{ "type": "curry", "tastiness": 1000 }"#)
204-
// .map({ $0.data(using: .utf8)! })
205-
// .flatMap(Food.decodeJSON(from:))
206-
//
207-
// let loadNetworkUser: FutureResult<User> = URLSession.shared
208-
// .dataTaskResult(with: URLRequest(url: URL(string: "https://foo.bar")!))
209-
// .mapResult({ $0.data })
210-
// .flatMapResult(User.decodeJSON(from:))
211-
//
212-
// let combinedFuture = zipResult3With(
213-
// loadStringFood,
214-
// loadFileUser,
215-
// loadNetworkUser
216-
// ) { (food: $0, user: $1, networkUser: $2) }
217-
// .mapResult({
218-
// "\($0.user.name) likes \($0.food.type) x\($0.food.tastiness)... networkUser: '\($0.networkUser.name)'"
219-
// })
220-
//
221-
// //
222-
// //combinedFuture.run { result in
223-
// // print(result)
224-
// //}
225-
//
226-
// Future.batchResult([ loadNetworkUser, loadFileUser ]).run { result in
227-
//// print(result)
228-
// }
229-
//
230-
// }
231185
}
232186

233187
extension Result {

0 commit comments

Comments
 (0)