[Catalyst] script/create.pl -mech controller (patch)

A. Pagaltzis pagaltzis at gmx.de
Fri Mar 3 16:41:38 CET 2006


* Carl Franks <fireartist at gmail.com> [2006-03-03 16:20]:
>Note: I've chosen the following method for the test skip
>
>our $test_count;
>BEGIN { $test_count = 2 }
>use Test::More tests => $test_count;
>
>SKIP: {
>    eval "use Test::WWW::Mechanize::Catalyst 'myapp'";
>    skip 'Test::WWW::Mechanize::Catalyst required', $test_count if $@;
>    ...
>}
>
>This is because I find if you try hard-coding the test count
>twice, as below, they can get out of sync. (I've found this
>problem on a module on cpan before).

    use Test::More;
    eval 'use Test::WWW::Mechanize::Catalyst qw( myapp )';
    plan $@
        ? skip_all => 'Test::WWW::Mechanize::Catalyst required'
        : tests => 2;

    # ...

Regards,
-- 
#Aristotle
*AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;



More information about the Catalyst mailing list