perlquestion
TStanley
After reading my copy of Perl Testing: A Developer's Notebook, and these [http://www.perl.com/pub/a/2002/07/10/tmo.html|two] [http://www.perl.com/pub/a/2005/04/07/mockobject_kata.html|articles], I started to tackle the newest test file:<BR>
<CODE>
use Test::More tests=>4;
use Test::MockObject;
use strict;
my $module='Games::QuizTaker';
my $TMO=Test::MockObject->new();
$TMO->fake_module($module => ('new' =>sub{ },
'load' =>sub{ },
'generate' =>sub{ },
'test' =>sub{ }));
use_ok($module);
can_ok($module,'new');
my $gq=Games::QuizTaker->new(filename=>'t/testqa');
can_ok($module,'load');
$gq->load;
can_ok($module,'generate');
$gq->generate;
</CODE>
However, make test is saying its a no go...<BR>
<CODE>
tstanley@perlmonk ~/modules/Games-QuizTaker $ make test
PERL_DL_NONLAZY=1 /usr/bin/perl5.8.8 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01load..........ok
t/02generate......ok
t/03test..........ok 1/4Can't call method "load" on an undefined value at t/03test.t line 18.
# Looks like you planned 4 tests but only ran 3.
# Looks like your test died just after 3.
t/03test..........dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED test 4
Failed 1/4 tests, 75.00% okay
t/04exceptions....ok
t/05pod...........ok
Failed Test Stat Wstat Total Fail List of Failed
-------------------------------------------------------------------------------
t/03test.t 255 65280 4 2 4
Failed 1/5 test scripts. 1/18 subtests failed.
Files=5, Tests=18, 1 wallclock secs ( 0.39 cusr + 0.04 csys = 0.43 CPU)
Failed 1/5 test programs. 1/18 subtests failed.
make: *** [test_dynamic] Error 255
tstanley@perlmonk ~/modules/Games-QuizTaker $
</CODE>
As always, clues and/or hints are welcome
<div class="pmsig"><div class="pmsig-21156">
<BR>TStanley<BR>
--------<BR>
<FONT SIZE=-1><I>People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf. -- George Orwell</I></FONT><BR>
</div></div>