Skip to content

Instantly share code, notes, and snippets.

@koromiko
Created September 7, 2017 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koromiko/4bfaca743323ee0b364b65545ad95d62 to your computer and use it in GitHub Desktop.
Save koromiko/4bfaca743323ee0b364b65545ad95d62 to your computer and use it in GitHub Desktop.
func test_save() {
//Give a todo item
let name = "Todo1"
let finished = false
let expect = expectation(description: "Context Saved")
waitForSavedNotification { (notification) in
expect.fulfill()
}
_ = sut.insertTodoItem(name: name, finished: finished)
//When save
sut.save()
//Assert save is called via notification (wait)
waitForExpectations(timeout: 1, handler: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment