cleaned up sub runner
[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';
4ebd5ecf 7use namespace::autoclean -except => [ qw(meta) ];
451b2a44 8
9has app => ( isa => 'Str', is => 'ro', required => 1 );
10has help => ( isa => 'Bool', is => 'ro', required => 0, default => sub { 0 } );
11
12
13sub run {
14 my $self = shift;
15
16 Class::MOP::load_class("Catalyst::Test");
17 Catalyst::Test->import($self->app);
18
19 pod2usage(1) if ( $self->help || !$ARGV[1] );
20 print request($ARGV[1])->content . "\n";
21
22}
23
0ba6e8aa 241;