Skip to content

Instantly share code, notes, and snippets.

@diatrevolo
Created March 3, 2016 15:42
Show Gist options
  • Save diatrevolo/67ef14be0a667e15ced3 to your computer and use it in GitHub Desktop.
Save diatrevolo/67ef14be0a667e15ced3 to your computer and use it in GitHub Desktop.
func testGetItems_withIncorrectArray() {
client = MyRESTClient(url: NSURL(string: "http://notRight")!, manager: manager!)
let expectation = expectationWithDescription("GetJSONArray")
var itemsArray: [MyItem]?
client?.getAvailableItems { (items) -> () in
itemsArray = items
expectation.fulfill()
}
waitForExpectationsWithTimeout(5) { (error: NSError?) -> Void in
XCTAssert(itemsArray?.count == nil, "Array should be empty when \"items\" array is missing")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment