Closed pirj closed 1 year ago
Do you think this could be released as new version?
Currently I had to load from source:
gem 'rspec-rails', '6.1.0.pre', github: 'rspec/rspec-rails', branch: 'main'
gem 'rspec', '3.13.0.pre', github: 'rspec/rspec', branch: 'main'
gem 'rspec-core', '3.13.0.pre', github: 'rspec/rspec-core', branch: 'main'
gem 'rspec-mocks', github: 'rspec/rspec-mocks', branch: 'main'
gem 'rspec-expectations', github: 'rspec/rspec-expectations', branch: 'main'
gem 'rspec-support', github: 'rspec/rspec-support', branch: 'main'
to fix the issue with mocking of method with keyword arguments
Released as 3.12.3
Thank you! This resolved the "keyword" argument mock issue in Ruby 3.2 for me. Yay! 🥳
The current re-implementation of
send
on verifying doubles uses*args
by itself. Everything works fine onmain
for Ruby 2 or lower, but on Ruby 3 this converts keyword arguments to a Hash element inside theargs
array, which then gets passed to__send__
and thensuper
and (correctly) causes a failure when the method gets a Hash instead of keywords.Without this patch, the new test passes on Ruby 2.7.6 and fails on Ruby 3.1.2:
With this patch, all tests pass on all Ruby versions.
Fixes #1485