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; |
f4de8c99 | 20 | 1; |
d3082fac | 21 | |
22 | =head1 NAME | |
23 | ||
24 | Catalyst::Script::Test - Test Catalyst application on the command line | |
25 | ||
26 | =head1 SYNOPSIS | |
27 | ||
3dcfb4c8 | 28 | myapp_test.pl [options] /path |
29 | ||
30 | Options: | |
31 | -h --help display this help and exits | |
d3082fac | 32 | |
33 | =head1 DESCRIPTION | |
34 | ||
3dcfb4c8 | 35 | Script to perform a test hit against your application and display the output. |
d3082fac | 36 | |
383c5be6 | 37 | =head1 SEE ALSO |
38 | ||
39 | L<Catalyst::ScriptRunner> | |
40 | ||
d3082fac | 41 | =head1 AUTHORS |
42 | ||
43 | Catalyst Contributors, see Catalyst.pm | |
44 | ||
45 | =head1 COPYRIGHT | |
46 | ||
47 | This library is free software. You can redistribute it and/or modify it under | |
48 | the same terms as Perl itself. | |
49 | ||
50 | =cut |