-
Notifications
You must be signed in to change notification settings - Fork 608
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
OCMExpect from selector #260
Comments
Not sure what the feature request is. If you want to test the implementation of If another class is using What am I missing? |
Sorry for beeing unclear: I don't want to test my ControlEventObserver class at all. That's just a helper to verify the behaviour if my custom UIControl. What I'm trying to do is to verify that my UIControl delivers the expected UIControlEvents to the object that has registered through the My current solution is a huge macro including a switch over the different UIControlEvent types that creates the expectations. TLDR: |
Finally got round to looking into this. It is possible to create an expectation from a selector. To do so you'd have to follow these steps:
Unfortunately, this requires several methods that are not in OCMock's public headers. |
This could be added to OCMock, maybe by adding a new method to
I'll leave this issue open as a feature request. |
Maybe this is an 'esoteric' feature request but I'd like to be able to declare an expectation from a selector variable.
I have a class with a method that returns different selectors based on the method parameter:
+ (SEL)actionForControlEvent:(UIControlEvents)event
and I want to declare an expectation from that selector:
Why do I want this?
I want to validate the behaviour of custom UIControls
The text was updated successfully, but these errors were encountered: