[Catalyst-commits] r12014 - in Catalyst-Devel/1.00/branches/helper_refactor: share/lib/MyApp/Controller share/script t

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Wed Nov 25 21:22:17 GMT 2009


Author: t0m
Date: 2009-11-25 21:22:17 +0000 (Wed, 25 Nov 2009)
New Revision: 12014

Modified:
   Catalyst-Devel/1.00/branches/helper_refactor/share/lib/MyApp/Controller/Root.pm.tt
   Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_server.pl.tt
   Catalyst-Devel/1.00/branches/helper_refactor/t/generated_app.t
Log:
Fix issues, more tests

Modified: Catalyst-Devel/1.00/branches/helper_refactor/share/lib/MyApp/Controller/Root.pm.tt
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/share/lib/MyApp/Controller/Root.pm.tt	2009-11-25 21:04:38 UTC (rev 12013)
+++ Catalyst-Devel/1.00/branches/helper_refactor/share/lib/MyApp/Controller/Root.pm.tt	2009-11-25 21:22:17 UTC (rev 12014)
@@ -20,10 +20,10 @@
 
 =head1 METHODS
 
-=cut
-
 =head2 index
 
+The root page (/)
+
 =cut
 
 sub index :Path :Args(0) {
@@ -33,6 +33,12 @@
     $c->response->body( $c->welcome_message );
 }
 
+=head2 default
+
+Standard 404 error page
+
+=cut
+
 sub default :Path {
     my ( $self, $c ) = @_;
     $c->response->body( 'Page not found' );

Modified: Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_server.pl.tt
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_server.pl.tt	2009-11-25 21:04:38 UTC (rev 12013)
+++ Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_server.pl.tt	2009-11-25 21:22:17 UTC (rev 12014)
@@ -1,7 +1,7 @@
 [% startperl %]
 
 BEGIN {
-    $ENV{CATALYST_SCRIPT_GEN} = [% script_gen %] 
+    $ENV{CATALYST_SCRIPT_GEN} = [% scriptgen %] 
 }
 
 use Catalyst::ScriptRunner;

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/generated_app.t
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/generated_app.t	2009-11-25 21:04:38 UTC (rev 12013)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/generated_app.t	2009-11-25 21:22:17 UTC (rev 12014)
@@ -4,8 +4,9 @@
 use File::Temp qw/ tempdir tmpnam /;
 use File::Spec;
 use Test::WWW::Mechanize;
+use Catalyst::Devel;
 
-my $dir = tempdir(); # CLEANUP => 1 );
+my $dir = tempdir( CLEANUP => 1 );
 my $devnull = File::Spec->devnull;
 
 use Test::More;
@@ -50,19 +51,19 @@
 script/testapp_create.pl
 |;
 
-plan 'tests' => scalar @files + 4;
-
 foreach my $fn (@files) {
     ok -r $fn, "Have $fn in generated app";
+    if ($fn =~ /script/) {
+        ok -x $fn, "$fn is executable";
+    }
 }
 
 ## Makefile stuff
 my $makefile_status = `$^X Makefile.PL`;
 ok $makefile_status, "Makefile ran okay";
 ok -e "Makefile", "Makefile exists";
-my $newapp_test_status = `prove -l t/ 2> $devnull`;
-ok $newapp_test_status, "Tests ran okay";
-#is $newapp_test_status, ;
+my $newapp_test_status = system("make", "test");
+ok !$newapp_test_status, "Tests ran okay";
 
 ## Moosey server tests - kmx++
 my $server_path   = File::Spec->catfile('script', 'testapp_server.pl');
@@ -82,4 +83,15 @@
 
 kill 'KILL', $childpid;
 
+my $server_script = do {
+    open(my $fh, '<', 'script/testapp_server.pl') or die $!;
+    local $/;
+    <$fh>;
+};
 
+ok $server_script =~ qr/CATALYST_SCRIPT_GEN}\s+=\s+(\d+)/,
+    'SCRIPT_GEN found in generated output';
+is $1, $Catalyst::Devel::CATALYST_SCRIPT_GEN, 'Script gen correct';
+
+done_testing;
+




More information about the Catalyst-commits mailing list