You're exactly right, spying on real objects in Mockito is not like
partial mocking in EasyMock. I cannot say we did it on purpose - the
implementation was the simplest possible. Plus, we cared about the
interface - to keep it clean enough, to keep constructors
refactorable, etc. Also, the case we implemented this feature for was
a bit different. Look, mockito spies were meant to help testing other
classes - not the spy itself (in your case:
MyClassToBePartiallyStubbed). This is where we can start a debate on
partial mocking: pure evil or handy tool :) (Please not unless you
really want to).
I agree that according to the javadoc you expect the mockito spy deal
with the case you provided. I will fix the docs. I don't know a clean
way of implementing EM's style of partial mocking - do you?
Cheers,
Szczepan Faber