Test it actually works
Tomas Doran [Wed, 11 Aug 2010 23:35:35 +0000 (00:35 +0100)]
t/generated_app.t

index 51cb3f1..6c7a66b 100644 (file)
@@ -84,8 +84,9 @@ command_ok( [ ($Config{make} || 'make') ] );
 
 run_generated_component_tests();
 
+my $server_script_file = File::Spec->catdir(qw/script testapp_server.pl/);
 my $server_script = do {
-    open(my $fh, '<', File::Spec->catdir(qw/script testapp_server.pl/)) or fail $!;
+    open(my $fh, '<', $server_script_file) or fail $!;
     local $/;
     <$fh>;
 };
@@ -95,6 +96,28 @@ 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';
 
+{
+    open(my $fh, '>', $server_script_file) or fail $!;
+    print $fh "MOO\n";
+}
+my $helper = Catalyst::Helper->new(
+    {
+        '.newfiles' => 0,
+        'makefile'  => 0,
+        'scripts'   => 1,
+        name => '.',
+    }
+);
+$helper->mk_app( '.' ) or fail;
+
+my $server_script_new = do {
+    open(my $fh, '<', $server_script_file) or fail $!;
+    local $/;
+    <$fh>;
+};
+
+is $server_script, $server_script_new;
+
 chdir('/');
 done_testing;