-
Notifications
You must be signed in to change notification settings - Fork 51
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
Composing black_hole
, predicates_return
and impersonate
?
#55
Comments
Just to further describe "weird":
Thinking about it now, I'm impersonating an ActiveRecord object, which probably is only defining certain methods once an instance is initialized. Thanks for the help (or even the sanity check of "don't do that") |
There is always a chance that, in the face of sufficient magic in another library, the answer will be "don't do that". However, if it's possible to make it work without too much special-case code I'd like to. Any chance you could work up a minimal reproduction of the issue? Preferably in the form of a test? |
Sure, I can put together a test. To avoid pulling in ActiveRecord as a test dependency (cringe), I'll try lightly reproducing in a test class how ActiveRecord implements |
So just poking at it a bit, it seems like defining (I can submit it as a pull request for easier diffs... though obviously it's failing at this point.) |
Thanks for the test case. This is an interesting case. Defining That said, it does bring into question whether we want some special treatment around Anyone have thoughts? @sferik? |
Just reviewing issues and seeing this comment now (over one year later). Anyway, I agree, filtering |
I'm running into really weird behavior when trying to compose combinations of
impersonate
,black_hole
, andpredicates_return(false)
in the same naught builder. Should I not do this?For example, I'd like the behavior that I can impersonate only methods of a class, that those methods are chainable, and that methods ending in
?
return a boolean. I can put together a test case if this is supposed to be supported... or I can propose an small warning to the docs (unless that warning is there and I'm missing it).The text was updated successfully, but these errors were encountered: