in reply to Re^2: ISA but no farther?
in thread ISA but no farther?

Sorry, missed that part; then you need to fix Test::MockObject to allow something like
ref($obj) eq 'OP' || ref($obj) eq 'Test::MockObject' && $obj->mocks('O +P')

Replies are listed 'Best First'.
Re^4: ISA but no farther?
by diotalevi (Canon) on Jul 20, 2006 at 17:18 UTC

    That's nasty. I'd just be requiring that objects be always mocked through Test::MockObject instead of some other kind of proxy or whatever.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

      As a variation on ysth's suggestion, you could require that the mocking class implement the 'mocks' method:

      ref($obj) eq 'OP' || $obj->can('mocks') && $obj->mocks('OP')

      Of course, if 'mocks' it handled through AUTOLOAD, this will fail.

        Is ->mocks a standard method name? I'd use it if it were.

        ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊