After reading my copy of Perl Testing: A Developer's Notebook, and these
two articles, I started to tackle the newest test file:
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;
However, make test is saying its a no go...
tstanley@perlmonk ~/modules/Games-QuizTaker $ make test
PERL_DL_NONLAZY=1 /usr/bin/perl5.8.8 "-MExtUtils::Command::MM" "-e" "t
+est_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 $
As always, clues and/or hints are welcome
TStanley
--------
People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf. -- George Orwell
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.