-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Kernel.warn when using Forwardable delegators with a null object #1441
Comments
It seems that this: def foo
bar
end can be removed, and the error still reproduces. |
Adding an expected result solves this, such as:
So I think this is an artefact from the forward, as instance doubles only verify methods which are stubbed, where as the spy mode calls |
By looking at the implementation, it doesn't look like I guess that spy is accepting and records every method call with I'd start with an attempt to reproduce the warning with a class defining dynamic methods used as a delegator target. |
Our doubles |
Subject of the issue
When using Forwardable delegators, if the destination object is a spy, a kernel warning will be emitted of the form:
Your environment
Steps to reproduce
Expected behavior
Both examples will pass.
Actual behavior
fowardable behavior with a null object (spy) is expected not to output to stderr
fails.The text was updated successfully, but these errors were encountered: