X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FScript%2FTest.pm;h=4209d62948a190cd232b316e0e9f3a4b274ed19f;hb=d0cacee71a316290bc01f0e12681c16bdc1e84e2;hp=8431fd2b3871119c8dd3254203b4d3da06a2b15e;hpb=451b2a4432a971fe5d12e108545677eb94295fab;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Script/Test.pm b/lib/Catalyst/Script/Test.pm index 8431fd2..4209d62 100644 --- a/lib/Catalyst/Script/Test.pm +++ b/lib/Catalyst/Script/Test.pm @@ -1,24 +1,50 @@ package Catalyst::Script::Test; use Moose; -use Pod::Usage; -use FindBin; -use lib "$FindBin::Bin/../lib"; -with 'MooseX::Getopt'; -use namespace::clean -except => [ qw(meta) ]; - -has app => ( isa => 'Str', is => 'ro', required => 1 ); -has help => ( isa => 'Bool', is => 'ro', required => 0, default => sub { 0 } ); +use Catalyst::Test (); +use namespace::autoclean; +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"; + } } + +__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