[Catalyst-commits] r11469 - in Catalyst-Plugin-Static-Simple/trunk: . t t/lib t/lib/TestApp t/lib/TestApp/Controller

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Tue Oct 6 16:32:02 GMT 2009


Author: t0m
Date: 2009-10-06 16:32:02 +0000 (Tue, 06 Oct 2009)
New Revision: 11469

Added:
   Catalyst-Plugin-Static-Simple/trunk/t/lib/TestApp/Controller/
   Catalyst-Plugin-Static-Simple/trunk/t/lib/TestApp/Controller/Root.pm
Modified:
   Catalyst-Plugin-Static-Simple/trunk/Changes
   Catalyst-Plugin-Static-Simple/trunk/t/11serve_static.t
   Catalyst-Plugin-Static-Simple/trunk/t/lib/TestApp.pm
Log:
Fix warnings in new Catalyst

Modified: Catalyst-Plugin-Static-Simple/trunk/Changes
===================================================================
--- Catalyst-Plugin-Static-Simple/trunk/Changes	2009-10-06 15:30:41 UTC (rev 11468)
+++ Catalyst-Plugin-Static-Simple/trunk/Changes	2009-10-06 16:32:02 UTC (rev 11469)
@@ -1,5 +1,8 @@
 Revision history for Perl extension Catalyst::Plugin::Static::Simple
 
+        - Move actions out of TestApp into a Root controller as
+          this is now deprecated.
+
 0.22    2009-08-21 18:14:59
         - Add tests for delivering empty files.
         - Fix those tests by depending on Catalyst-Runtime 5.80008.

Modified: Catalyst-Plugin-Static-Simple/trunk/t/11serve_static.t
===================================================================
--- Catalyst-Plugin-Static-Simple/trunk/t/11serve_static.t	2009-10-06 15:30:41 UTC (rev 11468)
+++ Catalyst-Plugin-Static-Simple/trunk/t/11serve_static.t	2009-10-06 16:32:02 UTC (rev 11469)
@@ -14,8 +14,8 @@
 is( $res->code, 200, '200 ok' );
 # .pm can be both application/x-pagemaker or text/x-perl, so only check for a slash
 like( $res->content_type, qr{/}, 'content-type ok' );
-like( $res->content, qr/serve_static/, 'content of serve_static ok' );
+like( $res->content, qr/package TestApp/, 'content of serve_static ok' );
 
 # test getting a non-existant file via serve_static_file
 ok( $res = request('http://localhost/serve_static_404'), 'request ok' );
-is( $res->code, 404, '404 ok' );
\ No newline at end of file
+is( $res->code, 404, '404 ok' );

Added: Catalyst-Plugin-Static-Simple/trunk/t/lib/TestApp/Controller/Root.pm
===================================================================
--- Catalyst-Plugin-Static-Simple/trunk/t/lib/TestApp/Controller/Root.pm	                        (rev 0)
+++ Catalyst-Plugin-Static-Simple/trunk/t/lib/TestApp/Controller/Root.pm	2009-10-06 16:32:02 UTC (rev 11469)
@@ -0,0 +1,45 @@
+package TestApp::Controller::Root;
+
+use strict;
+use warnings;
+use File::Spec::Functions;
+
+use base qw/Catalyst::Controller/;
+
+__PACKAGE__->config(namespace => '');
+
+sub default : Private {
+    my ( $self, $c ) = @_;
+    
+    $c->res->output( 'default' );
+}
+
+sub subtest : Local {
+    my ( $self, $c ) = @_;
+
+    $c->res->output( $c->subreq('/subtest2') );
+}
+
+sub subtest2 : Local {
+    my ( $self, $c ) = @_;
+    
+    $c->res->output( 'subtest2 ok' );
+}
+
+sub serve_static : Local {
+    my ( $self, $c ) = @_;
+    
+    my $file = catfile( $FindBin::Bin, 'lib', 'TestApp.pm' );
+    
+    $c->serve_static_file( $file );
+}
+
+sub serve_static_404 : Local {
+    my ( $self, $c ) = @_;
+    
+    my $file = catfile( $FindBin::Bin, 'lib', 'foo.pm' );
+    
+    $c->serve_static_file( $file );
+}
+
+1;

Modified: Catalyst-Plugin-Static-Simple/trunk/t/lib/TestApp.pm
===================================================================
--- Catalyst-Plugin-Static-Simple/trunk/t/lib/TestApp.pm	2009-10-06 15:30:41 UTC (rev 11468)
+++ Catalyst-Plugin-Static-Simple/trunk/t/lib/TestApp.pm	2009-10-06 16:32:02 UTC (rev 11469)
@@ -2,7 +2,6 @@
 
 use strict;
 use Catalyst;
-use File::Spec::Functions;
 use FindBin;
 
 our $VERSION = '0.01';
@@ -29,38 +28,4 @@
     return [ $c->config->{root} . '/incpath' ];
 }
 
-sub default : Private {
-    my ( $self, $c ) = @_;
-    
-    $c->res->output( 'default' );
-}
-
-sub subtest : Local {
-    my ( $self, $c ) = @_;
-
-    $c->res->output( $c->subreq('/subtest2') );
-}
-
-sub subtest2 : Local {
-    my ( $self, $c ) = @_;
-    
-    $c->res->output( 'subtest2 ok' );
-}
-
-sub serve_static : Local {
-    my ( $self, $c ) = @_;
-    
-    my $file = catfile( $FindBin::Bin, 'lib', 'TestApp.pm' );
-    
-    $c->serve_static_file( $file );
-}
-
-sub serve_static_404 : Local {
-    my ( $self, $c ) = @_;
-    
-    my $file = catfile( $FindBin::Bin, 'lib', 'foo.pm' );
-    
-    $c->serve_static_file( $file );
-}
-
 1;




More information about the Catalyst-commits mailing list