added documentation
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / Test.pm
CommitLineData
0ba6e8aa 1package Catalyst::Script::Test;
accb0640 2use Moose;
451b2a44 3use Pod::Usage;
4use FindBin;
5use lib "$FindBin::Bin/../lib";
6with 'MooseX::Getopt';
d9a32f71 7use namespace::autoclean;
451b2a44 8
d9a32f71 9has _app => (
10 reader => 'app',
11 init_arg => 'app',
12 traits => [qw(NoGetopt)],
13 isa => 'Str',
14 is => 'ro',
15);
16
17has 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
26sub 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 371;