X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Funit_core_script_fastcgi.t;h=1b24aea0885ce6fb3854a579791932d027f669cc;hb=88e5a8b0c4d28e46b8ba6b6b9567063e57af9063;hp=ed7b4224e13dacbd3bf8a194b4e27efff6ea6813;hpb=e40d69a759c3b50cc59a3419b64ced9d189456ca;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_core_script_fastcgi.t b/t/aggregate/unit_core_script_fastcgi.t index ed7b422..1b24aea 100644 --- a/t/aggregate/unit_core_script_fastcgi.t +++ b/t/aggregate/unit_core_script_fastcgi.t @@ -5,16 +5,16 @@ use FindBin qw/$Bin/; use lib "$Bin/../lib"; use Test::More; -use Test::Exception; +use Test::Fatal; use Catalyst::Script::FastCGI; -my $fake_handler = \42; +local our $fake_handler = \42; { package TestFastCGIScript; use Moose; - use namespace::autoclean; + use namespace::clean -except => [ 'meta' ]; extends 'Catalyst::Script::FastCGI'; @@ -32,13 +32,20 @@ sub testOption { local @ARGV = @$argstring; local @TestAppToTestScripts::RUN_ARGS; - lives_ok { + is exception { TestFastCGIScript->new_with_options(application_name => 'TestAppToTestScripts')->run; - } "new_with_options"; + }, undef, "new_with_options"; # First element of RUN_ARGS will be the script name, which we don't care about shift @TestAppToTestScripts::RUN_ARGS; + my $server = pop @TestAppToTestScripts::RUN_ARGS; is $server, $fake_handler, 'Loaded Plack handler gets passed to the app'; + + if (scalar(@TestAppToTestScripts::RUN_ARGS) && ref($TestAppToTestScripts::RUN_ARGS[-1]) eq "HASH") { + is ref(delete($TestAppToTestScripts::RUN_ARGS[-1]->{argv})), 'ARRAY'; + is ref(delete($TestAppToTestScripts::RUN_ARGS[-1]->{extra_argv})), 'ARRAY'; + } + is_deeply \@TestAppToTestScripts::RUN_ARGS, $resultarray, "is_deeply comparison"; }