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 and_call_original for Ruby 3.2 #1552

Closed igor-drozdov closed 1 year ago

igor-drozdov commented 1 year ago

When the original method isn't present, a proc that sends method_missing is returned. This block must support ruby2_keywords in order to work correctly with Ruby 3.2.

Otherwise, the following error is raised

     Failure/Error:
       def existing_method_with_args(arg, kwarg:)
         [arg, kwarg]
       end

     ArgumentError:
       wrong number of arguments (given 2, expected 1; required keyword: kwarg)
JonRowe commented 1 year ago

Thanks!

JonRowe commented 1 year ago

Released in 3.12.6