X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FScript%2FTest.pm;h=554026e3a33c01abe4c4d67e01d58c6561bc9025;hb=383c5be6711391bd114674e2dfb0b9e84a100a38;hp=cd9ed0b1505f9ee7420a9b1d692d13e8ee3b442e;hpb=d6e8e6644ac3a1c182b957bb57c2f8b330ba9334;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Script/Test.pm b/lib/Catalyst/Script/Test.pm index cd9ed0b..554026e 100644 --- a/lib/Catalyst/Script/Test.pm +++ b/lib/Catalyst/Script/Test.pm @@ -1,39 +1,49 @@ package Catalyst::Script::Test; use Moose; -use Pod::Usage; -use FindBin; -use lib "$FindBin::Bin/../lib"; -with 'MooseX::Getopt'; +use Catalyst::Test (); use namespace::autoclean; -has _app => ( - reader => 'app', - init_arg => 'app', - traits => [qw(NoGetopt)], - isa => 'Str', - is => 'ro', -); - -has help => ( - traits => [qw(Getopt)], - cmd_aliases => 'h', - isa => 'Bool', - is => 'ro', - documentation => qq{ display this help and exits }, -); - +with 'Catalyst::ScriptRole'; sub run { my $self = shift; - Class::MOP::load_class("Catalyst::Test"); - Catalyst::Test->import($self->app); - - pod2usage(1) if ( $self->help || !$ARGV[1] ); - print request($ARGV[1])->content . "\n"; + Catalyst::Test->import($self->application_name); + foreach my $arg (@{ $self->ARGV }) { + print request($arg)->content . "\n"; + } } -no Moose; + __PACKAGE__->meta->make_immutable; -1; + +=head1 NAME + +Catalyst::Script::Test - Test Catalyst application on the command line + +=head1 SYNOPSIS + + myapp_test.pl [options] /path + + Options: + -h --help display this help and exits + +=head1 DESCRIPTION + +Script to perform a test hit against your application and display the output. + +=head1 SEE ALSO + +L + +=head1 AUTHORS + +Catalyst Contributors, see Catalyst.pm + +=head1 COPYRIGHT + +This library is free software. You can redistribute it and/or modify it under +the same terms as Perl itself. + +=cut