From: Tomas Doran Date: Wed, 11 Aug 2010 23:35:35 +0000 (+0100) Subject: Test it actually works X-Git-Tag: 1.29~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5327ff9b0e22b5fb2f1f1c801a7df91a7fa9b695;p=catagits%2FCatalyst-Devel.git Test it actually works --- diff --git a/t/generated_app.t b/t/generated_app.t index 51cb3f1..6c7a66b 100644 --- a/t/generated_app.t +++ b/t/generated_app.t @@ -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;