hogsmill has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, Apologies if this is already posted - I thought I'd done it yesterday, but can't find it :-(

I'm trying to use Test::MockObject::Extends to test objects created using Object::InsideOut. Has anybody ever done this, and got it working. When I tried it, it fell over straight away when I tried to define the mock object...

Cheers,

Hogsmill

Replies are listed 'Best First'.
Re: Mocking Inside Out Objects
by shmem (Chancellor) on Feb 22, 2008 at 12:41 UTC
    I'm trying to use Test::MockObject::Extends to test objects created using Object::InsideOut.

    How? got some code to post? Error messages, at least?

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Re: Mocking Inside Out Objects
by hogsmill (Novice) on Feb 22, 2008 at 14:17 UTC
    Knew I'd forgotten something :-)

    Here you go...

    use DLMedia::Renderer; use Test::MockObject::Extends; my $obj = DLMedia::Renderer->new() ; $obj = Test::MockObject::Extends->new($obj) ;
    Gives...

    Modification of a read-only value attempted at /home/stevewells/perl/lib/perl5/site_perl/5.8.5/Test/MockObject/Extends.pm line 24.
    Cheers, Steve