More cleanups in the generated skeleton app
Tomas Doran [Mon, 5 Oct 2009 22:59:11 +0000 (22:59 +0000)]
share/Makefile.PL.tt
share/lib/MyApp.pm.tt
share/t/01app.t.tt
share/t/comptest.tt

index 383fc97..1fcbffd 100644 (file)
@@ -14,6 +14,7 @@ requires 'Moose';
 requires 'namespace::autoclean';
 requires 'Config::General'; # This should reflect the config file format you've chosen
                  # See Catalyst::Plugin::ConfigLoader for supported formats
+test_requires 'Test::More' => '0.88';
 catalyst;
 
 install_script glob('script/*.pl');
index 0032a13..a1fa271 100644 (file)
@@ -12,13 +12,16 @@ use Catalyst::Runtime 5.80;
 # Static::Simple: will serve static files from the application's root
 #                 directory
 
-use Catalyst qw/-Debug
-                ConfigLoader
-                Static::Simple/;
+use Catalyst qw/
+       -Debug
+    ConfigLoader
+    Static::Simple
+/;
 
 extends 'Catalyst';
 
 our $VERSION = '0.01';
+$VERSION = eval $VERSION;
 
 # Configure the application.
 #
@@ -29,7 +32,11 @@ our $VERSION = '0.01';
 # with an external configuration file acting as an override for
 # local deployment.
 
-__PACKAGE__->config( name => '[% name %]' );
+__PACKAGE__->config(
+       name => '[% name %]',
+       # Disable deprecated behavior needed by old applications
+       disable_component_resolution_regex_fallback => 1, 
+);
 
 # Start the application
 __PACKAGE__->setup();
index eb4e09a..d0f43dd 100644 (file)
@@ -1,8 +1,10 @@
 [% startperl %]
 use strict;
 use warnings;
-use Test::More tests => 2;
+use Test::More;
 
 BEGIN { use_ok 'Catalyst::Test', '[% name %]' }
 
 ok( request('/')->is_success, 'Request should succeed' );
+
+done_testing();
index acfcd97..533a5ff 100644 (file)
@@ -3,9 +3,10 @@ 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' );
 
@@ -21,3 +22,5 @@ ok( request('[% uri %]')->is_success, 'Request should succeed' );
 
 BEGIN { use_ok '[% class %]' }
 [% END %]
+
+done_testing();