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

Test and fix for call_through w/ instance methods #6

Closed
wants to merge 1 commit into from
Closed

Test and fix for call_through w/ instance methods #6

wants to merge 1 commit into from

Conversation

lreeves
Copy link
Contributor

@lreeves lreeves commented Aug 11, 2016

This adds a test case to spy on a method for any instance of an object while still returning the results of the original implementation:

Spy.on_instance_method(Foo, :bar).and_call_through

The bug is from the Proc that handles calling through not having a reference to the object receiving the method call; to fix that I've split the implementation Proc into two and adds the object instance in the call as appropriate.

@coveralls
Copy link

coveralls commented Aug 11, 2016

Coverage Status

Coverage decreased (-0.1%) to 30.947% when pulling 651ec6b on lreeves:master into 753e3ab on ryanong:master.

@ryanong
Copy link
Owner

ryanong commented Aug 17, 2016

Thanks for the PR. This code is getting a bit unweidly I am going to try and take a stab at simplifying it a bit

@lreeves
Copy link
Contributor Author

lreeves commented Aug 17, 2016

Sounds good, let me know if you need anything.

@lreeves lreeves closed this Nov 3, 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.

None yet

3 participants