fixed running unnder http server test failure and added some pod
John Napiorkowski [Thu, 8 Jul 2010 13:11:14 +0000 (13:11 +0000)]
Makefile.PL
lib/Catalyst/Engine/Loader.pm
t/aggregate/live_engine_request_env.t
t/lib/TestApp/View/Dump/Env.pm

index e69faa3..2b1fdae 100644 (file)
@@ -59,6 +59,7 @@ requires 'Plack::Middleware::ReverseProxy' => '0.04';
 test_requires 'Class::Data::Inheritable';
 test_requires 'Test::Exception';
 test_requires 'Test::More' => '0.88';
+test_requires 'Data::Dump';
 
 # aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate and a Test::Simple it works with is available
 if ($ENV{AGGREGATE_TESTS} && can_use('Test::Simple', '0.88') && can_use('Test::Aggregate', '0.35_05')) {
index bb23841..5de0acc 100644 (file)
@@ -39,4 +39,31 @@ around guess => sub {
 };
 
 __PACKAGE__->meta->make_immutable( inline_constructor => 0 );
+
 1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Engine::Loader - The Catalyst Engine Loader
+
+=head1 SYNOPSIS
+
+See L<Catalyst>.
+
+=head1 DESCRIPTION
+
+Wrapper on L<Plack::Loader> which resets the ::Engine if you are using some
+version of mod_perl.
+
+=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
index 571ee68..59a2219 100644 (file)
@@ -24,8 +24,6 @@ use HTTP::Headers;
 use HTTP::Request::Common;
 
 {
-    my $env;
-
     my $response = request("http://localhost/dump/env", {
         extra_env => { $EXPECTED_ENV_VAR => $EXPECTED_ENV_VAL },
     });
@@ -33,6 +31,8 @@ use HTTP::Request::Common;
     ok( $response, 'Request' );
     ok( $response->is_success, 'Response Successful 2xx' );
     is( $response->content_type, 'text/plain', 'Response Content-Type' );
+
+    my $env;
     ok( eval '$env = ' . $response->content, 'Unserialize Catalyst::Request' );
     is ref($env), 'HASH';
     ok exists($env->{PATH_INFO}), 'Have a PATH_INFO env var';
index a869be3..d713b0e 100644 (file)
@@ -13,5 +13,14 @@ sub process {
     });
 }
 
+## We override Data::Dumper here since its not reliably outputting
+## something that is roundtrip-able.
+
+sub dump {
+    my ( $self, $reference ) = @_;
+    use Data::Dump ();
+    return Data::Dump::dump($reference);
+}
+
 1;