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

Implement smarter KVC handling for class fakes #357

Merged
merged 1 commit into from
Jan 15, 2016
Merged

Conversation

briancroom
Copy link
Contributor

This is an attempt at addressing #355. I have confirmed with @pivotal-tom-mcneely that this patch does address the situation that prompted him to file the issue.

I tried not make the KVC implementation too smart. The -valueForKey: implementation won't try to call into any other stubbed methods to retrieve a value for return. The main goal was to ensure that calling -valueForKey: won't simply throw an exception in cases where a real instance of the class wouldn't.

- valueForKey:/valueForKeyPath: handling
- Superficially check for key validity
@briancroom
Copy link
Contributor Author

@idoru @tjarratt I've updated this based on your feedback. It no longer tries to determine whether the object being faked would be KVC-compliant for a given key.

Assuming CI goes green, how would you feel about merging this in?

@tjarratt
Copy link
Contributor

👍 Thanks for driving this out and continuously soliciting feedback, @briancroom. This has been a painful feature, both from an implementor's perspective and the community's.

tjarratt added a commit that referenced this pull request Jan 15, 2016
Implement smarter KVC handling for class fakes
@tjarratt tjarratt merged commit 5c273a9 into master Jan 15, 2016
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

Successfully merging this pull request may close these issues.

2 participants