added MX::Types::Moose
[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';
4e45780e 7use MooseX::Types::Moose qw/Str Bool/;
d9a32f71 8use namespace::autoclean;
451b2a44 9
d9a32f71 10has _app => (
11 reader => 'app',
12 init_arg => 'app',
13 traits => [qw(NoGetopt)],
14 isa => 'Str',
15 is => 'ro',
16);
17
18has help => (
19 traits => [qw(Getopt)],
20 cmd_aliases => 'h',
21 isa => 'Bool',
22 is => 'ro',
23 documentation => qq{ display this help and exits },
24);
451b2a44 25
26
27sub run {
28 my $self = shift;
29
30 Class::MOP::load_class("Catalyst::Test");
31 Catalyst::Test->import($self->app);
57dc50b0 32
451b2a44 33 pod2usage(1) if ( $self->help || !$ARGV[1] );
34 print request($ARGV[1])->content . "\n";
57dc50b0 35
451b2a44 36}
37
d6e8e664 38no Moose;
39__PACKAGE__->meta->make_immutable;
0ba6e8aa 401;