Subject: | T::MO::Extends->mock should duplicate prototype |
Test::MockObject::Extends->mock wraps the given sub with another sub.
However that wrapper currently has only an undefined prototype.
This raises a warning (Prototype mismatch) when the original method had
a different prototype.
So T:MO::E::mock should instead:
- copy the prototype of the given sub to the wrapper using Sub::Prototype
- check for mismatch between the given sub and the overwritten sub (to
help the T:MO user to diagnose the problem)
(of course, I know that using prototypes on object methods is usually
useless)
--
Olivier Mengué - http://perlresume.org/DOLMEN