rspec / rspec-mocks

RSpec's 'test double' framework, with support for stubbing and mocking
https://rspec.info
MIT License
1.16k stars 357 forks source link

Fix mocking keyword args via block implementation in Ruby 3.2 #1508

Closed adsteel closed 1 year ago

adsteel commented 1 year ago

👀 Check out first commit and switch Ruby versions 3.1.1 -> 3.20 to see passing -> failing spec, then check out second commit to see specs pass in both.

Default flag ruby2_keywords was declared a Ruby 3.0 bug and removed in Ruby 3.2. All methods that take *args that we also want to use to support keyword args must be explicitly instrumented via the ruby2_keywords method.

https://github.com/ruby/ruby/blob/07c19cf551e58e1b82af5efeb0047f10588fff9f/NEWS.md

JonRowe commented 1 year ago

Released in 3.12.2