Return true from the tests so that I can require them
[catagits/Catalyst-Devel.git] / share / t / comptest.tt
CommitLineData
239b5fc0 1use strict;
2use warnings;
3[% IF long_type == 'Controller' %][% IF mech %]use Test::More;
4
6fce1f9f 5eval "use Test::WWW::Mechanize::Catalyst '[% name %]'";
0c34c8b8 6if ($@) {
7 plan skip_all => 'Test::WWW::Mechanize::Catalyst required';
8 exit 0;
9}
239b5fc0 10
11ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' );
12
13$mech->get_ok( 'http://localhost[% uri %]' );
14[% ELSE %]use Test::More tests => 3;
15
6fce1f9f 16BEGIN { use_ok 'Catalyst::Test', '[% name %]' }
239b5fc0 17BEGIN { use_ok '[% class %]' }
18
19ok( request('[% uri %]')->is_success, 'Request should succeed' );
20[% END %]
21[% ELSE %]use Test::More tests => 1;
22
23BEGIN { use_ok '[% class %]' }
24[% END %]
0c34c8b8 25
26done_testing();
630702f2 271;