v1.9.0
Changelog
Add the ability to create delegate objects with MockObject
. This modifies MockObject
such that if provided with a class instance rather than a class name, it will delegate all method calls on the mock object to the delegate instance.
However, the mock will still retain the features of a MockObject
, like being able to add additional methods (using add_method()
) and being able to spy on method calls (using spy_on_method()
).
This change makes it possible to create a sort of proxy object which functions as normal, but allows spying on its method calls.
It also means that it's possible to mock certain methods of an object while retaining the full functionality of other methods.