cleaned up
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / Test.pm
1 package Catalyst::Script::Test;
2 use Moose;
3 use Pod::Usage;
4 use FindBin;
5 use lib "$FindBin::Bin/../lib";
6 with 'MooseX::Getopt';
7 use namespace::autoclean;
8
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 );
24
25
26 sub run {
27     my $self = shift;
28
29     Class::MOP::load_class("Catalyst::Test");
30     Catalyst::Test->import($self->app);
31
32     pod2usage(1) if ( $self->help || !$ARGV[1] );
33     print request($ARGV[1])->content  . "\n";
34
35 }
36
37 1;