added more to Test, added testapp_test, and worked on start_fcgi
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / Test.pm
index 191e91f..8431fd2 100644 (file)
@@ -1,3 +1,24 @@
 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 } );
+
+
+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";
+        
+}
+
 1;