X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=share%2Ft%2Fcomptest.tt;h=2c2c087418ddc6b35e458c4294bc729a9c3ad3e5;hb=9b153f7147b7ec6c8bd592ed6eaa962de4529fec;hp=00800f830c675cb075ead46e1c81edeb21fbf3b5;hpb=630702f27dbc5392bad17ecd7bd1f6e1fdf2d33c;p=catagits%2FCatalyst-Devel.git diff --git a/share/t/comptest.tt b/share/t/comptest.tt index 00800f8..2c2c087 100644 --- a/share/t/comptest.tt +++ b/share/t/comptest.tt @@ -1,27 +1,26 @@ use strict; use warnings; -[% IF long_type == 'Controller' %][% IF mech %]use Test::More; +use Test::More; +[% IF long_type == 'Controller' %][% IF mech %] -eval "use Test::WWW::Mechanize::Catalyst '[% name %]'"; -if ($@) { - plan skip_all => 'Test::WWW::Mechanize::Catalyst required'; - exit 0; +unless (eval q{use Test::WWW::Mechanize::Catalyst 0.55; 1}) { + plan skip_all => 'Test::WWW::Mechanize::Catalyst >= 0.55 required'; + exit 0; } -ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' ); +ok( my $mech = Test::WWW::Mechanize::Catalyst->new(catalyst_app => '[% name %]', 'Created mech object' ); $mech->get_ok( 'http://localhost[% uri %]' ); -[% ELSE %]use Test::More tests => 3; +[%- ELSE %] -BEGIN { use_ok 'Catalyst::Test', '[% name %]' } -BEGIN { use_ok '[% class %]' } +use Catalyst::Test '[% app %]'; +use [% class %]; ok( request('[% uri %]')->is_success, 'Request should succeed' ); -[% END %] -[% ELSE %]use Test::More tests => 1; +[%- END -%] +[% ELSE %] BEGIN { use_ok '[% class %]' } -[% END %] +[% END -%] done_testing(); -1;