Add tests and fix for ruby 3 keyword arguments issues
Created by: jhottenstein
I recently ran into a similar issue to #1396 (closed) when upgrading our codebase to ruby 3.
This PR adds tests for both scenarios (receive
with a block with kwargs and and_call_original
when mocking a method that uses keyword arguments). The tests may be redundant since fixing recorder fixed both tests.
I noticed other spots where define_method is used to intercept method calls (e.g. https://github.com/rspec/rspec-mocks/blob/0a52e0a86b126b4bab94d277b2ad99a7492dc37d/lib/rspec/mocks/any_instance/chain.rb#L27 and https://github.com/rspec/rspec-mocks/blob/0a52e0a86b126b4bab94d277b2ad99a7492dc37d/lib/rspec/mocks/matchers/receive.rb#L61) so this PR may not be sufficient to fix all keyword argument issues