-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Ruby 3+ causes an empty diff error when using expect .... to receive
#1370
Comments
👋 We're aware, there a couple of similar issues surrounding diffing keyword hashes vs normal hashes. We're working on it :) |
Great to hear. I did manage to fix my bug luckily. Just yeh keep up the great work! |
In Ruby 3.1 method args must be explicitly wrapped in `{}` in order to be passed as a `Hash` and not interperated as keword-args. This commit adds `{}` to various `expect` calls so that RSpec can correctly validate the expectations. See also rspec/rspec-expectations#1370
I am getting this error now. What is the solution? |
The solution is to "check" manually whether your hashing the kwargs correctly. I use the term solution because it's actually broken. I.e. your tests are failing validly. Because you've made a user error. Just that rspec doesn't highlight this error nicely. |
Subject of the issue
I'm running CI.
When using ruby3 I get a weird error I'm struggling to triage. I'm 99% certain I'm doing something wrongWhen using ruby3, the keyword args vs hashable args isn't being picked up from rspec expectations. Maybe add a line in to the debug message advising people to check this?
Your environment
Steps to reproduce
View this CI run: https://github.com/site-prism/site_prism/runs/6226827374?check_suite_focus=true
Expected behavior
Ruby 3 doesn't give an error, or if I've done something wrong I know what to fix...
EDIT: This is caused by the hashable args issue / keyword issue.
Actual behavior
Related to #123
We get a diff where there is no error
One specific example is....
Suggested solution
The text was updated successfully, but these errors were encountered: