jmcada has asked for the wisdom of the Perl Monks concerning the following question:
package X; use base qw(Test::Class); use Test::More; use Test::MockClass; sub setup : Test(setup) { my ($self) = @_; my $mockClass = Test::MockClass->new('DateTime'); $mockClass->addMethod('now', sub {'XXXX'}); } sub test : Test { my ($self) = @_; ok(DateTime->now); diag(DateTime->now); } 1; package Y; use base qw(Test::Class); use Test::More; use DateTime; sub test : Test { my ($self) = @_; ok(DateTime->now); diag(DateTime->now); } 1; package Z; use Test::Class; Test::Class->runtests; 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mocking Classes and Test::Class
by xdg (Monsignor) on Mar 14, 2006 at 17:02 UTC | |
|
Re: Mocking Classes and Test::Class
by adrianh (Chancellor) on Mar 15, 2006 at 11:59 UTC |