Commit | Line | Data |
0ba6e8aa |
1 | package Catalyst::Script::Test; |
accb0640 |
2 | use Moose; |
451b2a44 |
3 | use Pod::Usage; |
4 | use FindBin; |
5 | use lib "$FindBin::Bin/../lib"; |
6 | with 'MooseX::Getopt'; |
d9a32f71 |
7 | use namespace::autoclean; |
451b2a44 |
8 | |
d9a32f71 |
9 | has _app => ( |
10 | reader => 'app', |
11 | init_arg => 'app', |
12 | traits => [qw(NoGetopt)], |
13 | isa => 'Str', |
14 | is => 'ro', |
15 | ); |
16 | |
17 | has help => ( |
18 | traits => [qw(Getopt)], |
19 | cmd_aliases => 'h', |
20 | isa => 'Bool', |
21 | is => 'ro', |
22 | documentation => qq{ display this help and exits }, |
23 | ); |
451b2a44 |
24 | |
25 | |
26 | sub run { |
27 | my $self = shift; |
28 | |
29 | Class::MOP::load_class("Catalyst::Test"); |
30 | Catalyst::Test->import($self->app); |
57dc50b0 |
31 | |
451b2a44 |
32 | pod2usage(1) if ( $self->help || !$ARGV[1] ); |
33 | print request($ARGV[1])->content . "\n"; |
57dc50b0 |
34 | |
451b2a44 |
35 | } |
36 | |
0ba6e8aa |
37 | 1; |