Closed nashbridges closed 2 years ago
@pirj thanks for reviewing this!
I'm not fully sure if this is an expected Ruby behavior, but the current fix is to repeat the definition in the subclass.
It is expected, there is no "inheritance" of ruby2_keywords
or anything like that, each method which needs to delegate kwargs through *args
needs ruby2_keywords
.
This is a follow-up to https://github.com/rspec/rspec-mocks/pull/1394.
The change introduced in that PR handle a pure double, but not an instance double.
The reason is that
VerifyingMessageExpectation
is a subclass ofMessageExpectation
withwith
method being overridden. That makesruby2_keywords
definition declared in the superclass to be "dropped" (and therefore to confuse theHash.ruby2_keywords_hash?
check).I'm not fully sure if this is an expected Ruby behavior, but the current fix is to repeat the definition in the subclass.