Meh, that shows what I mean. This can be done waaaay more elegantly by abstracting...
[catagits/Catalyst-Runtime.git] / t / unit_core_script_server.t
1 use strict;
2 use warnings;
3
4 use FindBin qw/$Bin/;
5 use lib "$Bin/lib";
6
7 use Test::More 'no_plan';
8 use Test::Exception;
9
10 use Catalyst::Script::Server;
11
12 {
13     local @ARGV; # Blank
14     local @TestAppToTestScripts::RUN_ARGS;
15     lives_ok {
16         Catalyst::Script::Server->new_with_options(application_name => 'TestAppToTestScripts')->run;
17     };
18     is_deeply \@TestAppToTestScripts::RUN_ARGS, ['TestAppToTestScripts',
19           '3000',
20           'localhost',
21           {
22             'pidfile' => undef,
23             'fork' => undef,
24             'follow_symlinks' => undef,
25             'background' => undef,
26             'keepalive' => undef
27           }];
28 }
29
30 {
31     local @ARGV = qw/-p 3001/;
32     local @TestAppToTestScripts::RUN_ARGS;
33     lives_ok {
34         Catalyst::Script::Server->new_with_options(application_name => 'TestAppToTestScripts')->run;
35     };
36     is_deeply \@TestAppToTestScripts::RUN_ARGS, ['TestAppToTestScripts',
37           '3001',
38           'localhost',
39           {
40             'pidfile' => undef,
41             'fork' => undef,
42             'follow_symlinks' => undef,
43             'background' => undef,
44             'keepalive' => undef
45           }];
46 }