-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Expectation with method missing self.class.define_method name && send(name)
fails
#1348
Comments
Wow, interesting find. Thanks for reporting. |
This is because we "stash" the original method at the time of the expectation, to later invoke if needed, in this case it appears we stash the method missing implementation, which I don't think is the intent, so when later defined it doesn't (indeed can't) short circuit. As an aside I would say this kind of expectation is not something we would recommend as a good idea; you're asserting that a method is called, then calling it, which in itself is pretty pointless. If you tested the side effects of calling this method you wouldn't see this bug. |
Subject of the issue
This https://github.com/drapergem/draper/blob/master/lib/draper/helper_proxy.rb
Your environment
Steps to reproduce
Run testcase
Expected behavior
It works!
Actual behavior
The text was updated successfully, but these errors were encountered: