Commit | Line | Data |
---|---|---|
0ba6e8aa | 1 | package Catalyst::Script::Test; |
accb0640 | 2 | use Moose; |
95389116 | 3 | use Catalyst::Test (); |
d9a32f71 | 4 | use namespace::autoclean; |
451b2a44 | 5 | |
d3082fac | 6 | with 'Catalyst::ScriptRole'; |
451b2a44 | 7 | |
8 | sub run { | |
9 | my $self = shift; | |
10 | ||
e25affcb | 11 | Catalyst::Test->import($self->application_name); |
57dc50b0 | 12 | |
83065d4d | 13 | foreach my $arg (@{ $self->ARGV }) { |
14 | print request($arg)->content . "\n"; | |
15 | } | |
451b2a44 | 16 | } |
17 | ||
73e4f0f1 | 18 | |
d6e8e664 | 19 | __PACKAGE__->meta->make_immutable; |
d3082fac | 20 | |
21 | =head1 NAME | |
22 | ||
23 | Catalyst::Script::Test - Test Catalyst application on the command line | |
24 | ||
25 | =head1 SYNOPSIS | |
26 | ||
3dcfb4c8 | 27 | myapp_test.pl [options] /path |
28 | ||
29 | Options: | |
30 | -h --help display this help and exits | |
d3082fac | 31 | |
32 | =head1 DESCRIPTION | |
33 | ||
3dcfb4c8 | 34 | Script to perform a test hit against your application and display the output. |
d3082fac | 35 | |
36 | =head1 AUTHORS | |
37 | ||
38 | Catalyst Contributors, see Catalyst.pm | |
39 | ||
40 | =head1 COPYRIGHT | |
41 | ||
42 | This library is free software. You can redistribute it and/or modify it under | |
43 | the same terms as Perl itself. | |
44 | ||
45 | =cut |