Skip to content

Fix stubbing prepended only methods

Created by: godfat

Previously, we're assuming the method must be defined in the singleton class. However this is not always true. Whenever the method was only defined in the prepended module, then it's not defined in the singleton class. We need to find the owner of the method instead, which is the prepended module.

Closes https://github.com/rspec/rspec-mocks/issues/1213

Merge request reports