Mutant has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; package Foo; sub new { my $class = shift; return bless {}, $class; } sub bar { my $self = shift; $self->baz; return 1; } sub baz { die; } 1;
use strict; use warnings; use Foo; use Test::MockObject::Extends; my $foo = Foo->new(); my $mock_foo = Test::MockObject::Extends->new( $foo ); $mock_foo->mock('baz',sub { 1 }); $mock_foo->bar;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test::MockObject::Extends question
by chromatic (Archbishop) on Jul 15, 2005 at 17:15 UTC | |
by Mutant (Priest) on Jul 18, 2005 at 08:21 UTC |