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>;
};
'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;
local $ENV{CATALYST_DEBUG} = 0;
foreach my $fn (@generated_component_tests) {
subtest "Generated app test: $fn", sub {
- require $fn;
+ do $fn;
};
}
}