Somewhat fix the scripts and tests
[catagits/Catalyst-Devel.git] / share / t / comptest.tt
1 use strict;
2 use warnings;
3 [% IF long_type == 'Controller' %][% IF mech %]use Test::More;
4
5 eval "use Test::WWW::Mechanize::Catalyst '[% name %]'";
6 plan $@
7     ? ( skip_all => 'Test::WWW::Mechanize::Catalyst required' )
8     : ( tests => 2 );
9
10 ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' );
11
12 $mech->get_ok( 'http://localhost[% uri %]' );
13 [% ELSE %]use Test::More tests => 3;
14
15 BEGIN { use_ok 'Catalyst::Test', '[% name %]' }
16 BEGIN { use_ok '[% class %]' }
17
18 ok( request('[% uri %]')->is_success, 'Request should succeed' );
19 [% END %]
20 [% ELSE %]use Test::More tests => 1;
21
22 BEGIN { use_ok '[% class %]' }
23 [% END %]