Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCMObserverMockObject doesn't have a reject method #114

Closed
pilky opened this issue Jul 11, 2014 · 4 comments
Closed

OCMObserverMockObject doesn't have a reject method #114

pilky opened this issue Jul 11, 2014 · 4 comments

Comments

@pilky
Copy link

pilky commented Jul 11, 2014

I have some code which should only post a notification under certain circumstances. While observer mocks work great for testing if a notification was posted, they don't work for testing that a notification wasn't sent as they lack a -reject method.

@erikdoe
Copy link
Owner

erikdoe commented Jul 11, 2014

Observer mocks are meant to be strict (as mentioned in http://ocmock.org/reference/#observer-mocks). Is that not the case? Does the observer receive an unexpected notification and not complain? That would be a bug.

@pilky
Copy link
Author

pilky commented Jul 11, 2014

Ah, I missed that. Guess I need to have more caffeine before reading documentation.

@erikdoe
Copy link
Owner

erikdoe commented Jul 11, 2014

Partly my fault, too. The design isn't very symmetric. In the new syntax class mocks, partial mocks, and protocol mocks are all created "nice" by default while observer mocks are strict by default. In hindsight I don't know how I end up there.

@erikdoe erikdoe closed this as completed Jul 31, 2014
@Buju77
Copy link

Buju77 commented Oct 27, 2015

sry for re-using this issue, but how do I implement rejecting a specific notification I don't want to receive?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants