Fix bug with generated component classes and an issue with the test
[catagits/Catalyst-Devel.git] / share / t / comptest.tt
index acfcd97..ca044c9 100644 (file)
@@ -3,16 +3,17 @@ use warnings;
 [% IF long_type == 'Controller' %][% IF mech %]use Test::More;
 
 eval "use Test::WWW::Mechanize::Catalyst '[% name %]'";
-plan $@
-    ? ( skip_all => 'Test::WWW::Mechanize::Catalyst required' )
-    : ( tests => 2 );
+if ($@) {
+    plan skip_all => 'Test::WWW::Mechanize::Catalyst required';
+       exit 0;
+}
 
 ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' );
 
 $mech->get_ok( 'http://localhost[% uri %]' );
 [% ELSE %]use Test::More tests => 3;
 
-BEGIN { use_ok 'Catalyst::Test', '[% name %]' }
+BEGIN { use_ok 'Catalyst::Test', '[% app %]' }
 BEGIN { use_ok '[% class %]' }
 
 ok( request('[% uri %]')->is_success, 'Request should succeed' );
@@ -21,3 +22,6 @@ ok( request('[% uri %]')->is_success, 'Request should succeed' );
 
 BEGIN { use_ok '[% class %]' }
 [% END %]
+
+done_testing();
+1;