-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
.and_call_original
breaks on Ruby 3.2 for methods with keyword arguments
#1512
Comments
.and_call_original
for methods with keyword arguments.and_call_original
breaks on Ruby 3.2 for methods with keyword arguments
Thanks for reporting. Does it help to insert ruby2_keywords msg if respond_to?(:ruby2_keywords, true) here? |
Doesn't seem to make a difference :/ |
Can you please check if #1514 fixes this case? |
@pirj Yup, that seems to fix it! By the way, I'm not sure what the simplest way of running a specific branch of a dependency is, I struggled a bit, here's what I tried:
|
@ric2b Here's how I tested that branch: %w[rspec-core rspec-expectations rspec-support rspec-rails].each do |lib|
gem lib, git: "https://github.com/rspec/#{lib}.git", branch: "main"
end
gem "rspec-mocks", git: "https://github.com/rspec/rspec-mocks.git", branch: "ruby-3.2" It's based on the snippet in the README of this repo, except Note that I also include |
I had a related problem in that branch. Perhaps this isn't fixed, or perhaps the fix broke something else. It's detailed in the PR of that branch: |
After updating to Ruby 3.2.3 we have been hit by rspec/rspec-mocks#1512 of rspec. Therefore we update to the latest rspec version here.
Subject of the issue
With Ruby 3.2 rspec-mocks seems to not pass keyword arguments to the original implementation of a method when using
.and_call_original
Your environment
Steps to reproduce
I was able to create this minimal test that reproduces the issue:
Expected behavior
The test should pass
Actual behavior
The test fails on the second
A
instantiation with the error:ArgumentError: wrong number of arguments (given 1, expected 0; required keyword: kw)
The text was updated successfully, but these errors were encountered: