-
-
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
Verifying doubles do not differentiate between a Hash and keyword args in Ruby 3 #1481
Comments
This is at least partially fixed by #1473 (when
|
I'm running into this with the latest rspec-mocks (version 3.12.5). It's making the upgrade from Ruby 2.7 to 3.x, extra painful. |
@honigc - could you elaborate here? Is the confusing bit that I'm curious if there's still any change needed here. |
Correct, it is because |
Subject of the issue
When using an
instance_double
of a class that defines an instance method that takes keyword arguments, then usingallow
orexpect
to stub that method in the verifying double, the method can be called on the verifying double with either keywords or a Hash object passed. This happens whether or notwith
is used when setting up the stub.When using live objects, passing a Hash without a double-splat raises
ArgumentError
in Ruby 3 while it worked fine in Ruby 2.7. The fact that tests don't fail in this situation in Ruby 3 has made upgrading Ruby in a large project more complicated.Your environment
Steps to reproduce
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: