Cuckoo
Cuckoo copied to clipboard
OCMock - How to verify that a method has been called a certain number of times
Currently I wanna make sure that the method numberOfSections(in:) just called only once time, any posibilty to make it as objcVerify(mock, times(1)).numberOfSections(in: tableView))? thanks 🙏
// stubbing the class is very similar to stubbing with Cuckoo
let mock = objcStub(for: UITableViewController.self) { stubber, mock in
stubber.when(mock.numberOfSections(in: tableView)).thenReturn(1)
}
objcVerify(mock.numberOfSections(in: tableView))
We may not have support for this at the moment. If you're feeling adventurous, feel free to add the feature yourself. I feel like this should not be too difficult to add. If you do file a PR along with some tests, I'm sure we can get this added in no time.