The first test failures I get with your code are #2 and #3, testing that $c is a 'Foo'. It isn't.
A MockFoo is not a Foo. If perl thought it were, perl would burrow into the Foo namespace for methods and ignore the mocked-up ones.
I suspect your difficulty with id() comes from the closure behaving unexpectedly, but I can't prove it.
After Compline,
Zaxo
In reply to Re: Test::MockObject subclassing befuddlement
by Zaxo
in thread Test::MockObject subclassing befuddlement
by water
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |