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

Forwarding all invocations to real object by default in "nice" partial mock #77

Closed
stefreak opened this issue Apr 2, 2014 · 2 comments

Comments

@stefreak
Copy link

stefreak commented Apr 2, 2014

I'm having a very similar problem to #68 - I'm using partial mocks of NSManagedObjects to test my core data models.

At some places, I'm using real NSManagedObjects and that works great, at others I need to mock certain methods that produce computed values out of the model data, because they depend on a deep hierarchy of related NSManagedObjects.

When I mock these methods however, properties of these objects cannot be used anymore because there seems to be no way at the moment to mock them or set them.

What do you think about optionally having "nice" partial mocks, which behave just like the real objects except for the methods that have been mocked via andReturnValue:?

@erikdoe
Copy link
Owner

erikdoe commented Apr 4, 2014

Not sure I understand. Partial mocks do behave like the real object for all methods that aren't stubbed. Line 217 in the current implementation of OCPartialMockObject: if the invocation is not "recorded", which is OCMock's internal lingo for saying it's not stubbed, then it is forwarded to the real object. My assumption is that you mean something different, especially because you reference an issue with key-value lookups. Can you clarify?

@erikdoe
Copy link
Owner

erikdoe commented Aug 20, 2014

Closing this due to inactivity. Please shout if you have further information.

@erikdoe erikdoe closed this as completed Aug 20, 2014
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

2 participants