-
-
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
Rename verifying double callback and expand to partial doubles. #940
Conversation
) | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These specs show that the callback is called but don't show when it gets called. Is it called when expect_any_instance_of(...).to receive
is used? Is it called before implemented
gets called? Or after those? It would be nice if the spec would make that explicit (which may require you to move away from using yield_successive_args
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also show use of allow_any_instance_of
and allow
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they verify methods? If they do then we should otherwise it doesn't really matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they verify methods? If they do then we should otherwise it doesn't really matter?
Yes, when verify_partial_double
is enabled we apply verification to both expect
and allow
. It would be a bug if we did not. As such I think we should have specs for them here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, ok, I'll add them
Given that we plan to move |
Yes, I still feel it makes sense to have this callback for all verifying doubles, including partial ones. The only complication I can think of for removing |
39b05f9
to
3c40d80
Compare
LGTM. Thoughts on what to do about the app veyor failures? They seem consistent now and I really don't want to keep ignoring. |
Add some way of filtering libraries and then ignore bundler? |
The bundler warning has been fixed: So maybe we can force it to use a newer or older version of bundler that doesn't have that warning? |
See spike at rspec/rspec-support#203, seems we've been pinning it lower |
162e3dd
to
23794df
Compare
23794df
to
1826212
Compare
Rename verifying double callback and expand to partial doubles.
Mind if I ask why this is going away completely? While I understand it is an antipattern, it is sometimes a necessary evil when dealing with legacy code. Is there a mailing list or other place where this discussion is taking or has already taken place so I can get more info? |
It's not going to go away completely -- we just plan for it to be extracted into a separate gem (something like
And as you said, it's an antipattern...on the one hand you're trying to be specific about a specific message being received with specific arguments, but on the other hand you're not being specific about the most important aspect of the method call: the receiver. We want to continue to support users who rely on this feature by making it available in another gem, without continuing to bear the cost of maintaining it. Hopefully we'll be able to find someone from the community who is willing to step up and maintain it :). |
@myronmarston Thanks for the detailed explanation. I am glad to hear it is not going away, that would make my life very, very painful due to excessive use (by others) of this feature. I would be happy to help with what I can, but I have very little understanding of the rspec internals at this point. |
This is prep for fixing rspec/rspec-rails#1357 (well actually I think it fixes it but I haven't check from the other side yet so... starting here)