Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Honza Dvorsky committed Apr 12, 2015
1 parent ff67237 commit f0cb908
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions BuildaGitServerTests/GitHubServerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ class GitHubSourceTests: XCTestCase {
self.tryEndpoint(.GET, endpoint: .PullRequests, params: params) { (body, error) -> () in

XCTAssertNotNil(body, "Body must be non-nil")
let prs: [PullRequest] = GitHubArray(body as! NSArray)
XCTAssertGreaterThan(prs.count, 0, "We need > 0 items to test parsing")
Log.verbose("Parsed PRs: \(prs)")
if let body = body as? NSArray {
let prs: [PullRequest] = GitHubArray(body as! NSArray)
XCTAssertGreaterThan(prs.count, 0, "We need > 0 items to test parsing")
Log.verbose("Parsed PRs: \(prs)")
} else {
XCTFail("Body nil")
}
}
}

Expand All @@ -71,9 +75,13 @@ class GitHubSourceTests: XCTestCase {
self.tryEndpoint(.GET, endpoint: .Branches, params: params) { (body, error) -> () in

XCTAssertNotNil(body, "Body must be non-nil")
let branches: [Branch] = GitHubArray(body as! NSArray)
XCTAssertGreaterThan(branches.count, 0, "We need > 0 items to test parsing")
Log.verbose("Parsed branches: \(branches)")
if let body = body as? NSArray {
let branches: [Branch] = GitHubArray(body)
XCTAssertGreaterThan(branches.count, 0, "We need > 0 items to test parsing")
Log.verbose("Parsed branches: \(branches)")
} else {
XCTFail("Body nil")
}
}
}

Expand Down

0 comments on commit f0cb908

Please sign in to comment.