On Thu, Dec 13, 2001 at 02:07:56PM -0500, Kirrily Robert wrote:
> Actually, Test::Mail doesn't work like that.  It's more or less a
> wrapper around Test::More that handles incoming email.  Doesn't
> implement any of its own ok()-like routines at all, just makes it easy
> to use Test::More's routines on incoming email.

Ahh, in that case I might suggest instead of doing:

    *Test::Simple::TESTOUT = \*LOG;
    *Test::Simple::TESTERR = \*LOG;
    *Test::More::TESTERR   = \*LOG;
    eval qq( 
        package $package;  
        use Test::More 'no_plan'; 
        &${package}::$sub; 
    );

which I have a feeling isn't going to work anymore, those filehandles
are gone, you should do:

    $t = Test::Builder->new;
    $t->output(\*LOG);
    $t->failure_output(\*LOG);
    $t->todo_output(\*LOG);

    eval qq(
        package $package;
        use Test::More 'no_plan';

        \n#line 1 $msgid
        &${package}::$sub;
    );

The "#line 1 $msgid" bit is so the failure output doesn't all say
"Failed at /usr/local/share/perl/5.6.1/Test/Mail.pm line 58".  But
instead maybe something a little more meaningful like "Failed at
[EMAIL PROTECTED] line 4" so you can at least track it back
to the email which caused the problem.

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
you're a bleeding-heart
liberal.  LET ME PLUG MY
ASS WITH PASTE RIGHT NOW!
        -- japhy

Reply via email to