-
-
Notifications
You must be signed in to change notification settings - Fork 358
[have_receive] (not have_receive"d") will return true no matter what #1288
Comments
👋 Hi, you've fallen victim to a typo leading you to a strange inconsistency. Whats happening here...
A work arounds to avoid this is to use a verifying double rather than a normal spy, which would then recognise the non existant method and help highlight the issue. I think a proper fix is needed here too, but that will require us detecting spys in the magic matcher and special casing them, WDYT @benoittgt |
Thanks for your issue @github0013
I don't see exactly what you mean here. Isn't breaking the contract of rspec-mocks/lib/rspec/mocks/example_methods.rb Lines 117 to 122 in d0cd8df
|
@benoittgt |
As with #1132, I think this might be closeable now - the actual behavior is still there, but the problem case now causes:
At some point in the last four years, the matcher started checking for true/false, instead of truthy/falsey values. Edit: As pointed out here, this was from the |
I'm closing this one in favour of #1132 |
Subject of the issue
Calling
have_receive
always become true. (nothave_receive[d]
)have_receive
, does this matcher method exist?https://relishapp.com/rspec/rspec-mocks/docs/basics/spies
I only see
have_receive[d]
Your environment
Steps to reproduce
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: