Returned the foo() action to TestAppPathBug.pm so it tests the right bug. Added a...
Yousef H. Alhashemi [Sun, 16 Aug 2009 18:08:03 +0000 (18:08 +0000)]
t/lib/TestAppPathBug.pm
t/lib/TestAppPathBug/Controller/Root.pm [deleted file]
t/lib/TestAppStats.pm
t/lib/TestAppStats/Controller/Root.pm [new file with mode: 0644]

index 04582a7..a91b5fe 100644 (file)
@@ -3,6 +3,8 @@ use warnings;
 
 package TestAppPathBug;
 
+BEGIN { $SIG{__WARN__} = sub {}; };
+
 use Catalyst;
 
 our $VERSION = '0.01';
@@ -11,4 +13,9 @@ __PACKAGE__->config( name => 'TestAppPathBug', root => '/some/dir' );
 
 __PACKAGE__->setup;
 
+sub foo : Path {
+    my ( $self, $c ) = @_;
+    $c->res->body( 'This is the foo method.' );
+}
+
 1;
diff --git a/t/lib/TestAppPathBug/Controller/Root.pm b/t/lib/TestAppPathBug/Controller/Root.pm
deleted file mode 100644 (file)
index 6fda94e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-package TestAppPathBug::Controller::Root;
-
-use base 'Catalyst::Controller';
-
-__PACKAGE__->config->{namespace} = '';
-
-sub foo : Path {
-    my ( $self, $c ) = @_;
-    $c->res->body( 'This is the foo method.' );
-}
-
-1;
index bfc1340..6e3b320 100644 (file)
@@ -16,16 +16,8 @@ __PACKAGE__->log(TestAppStats::Log->new);
 
 __PACKAGE__->setup;
 
-# Return log messages from previous request
-sub default : Private {
-    my ( $self, $c ) = @_;
-    $c->stats->profile("test");
-    $c->res->body(join("\n", @log_messages));
-    @log_messages = ();
-}
-
 package TestAppStats::Log;
 use base qw/Catalyst::Log/;
 
-sub info { push(@log_messages, @_); }
-sub debug { push(@log_messages, @_); }
+sub info { push(@TestAppStats::log_messages, @_); }
+sub debug { push(@TestAppStats::log_messages, @_); }
diff --git a/t/lib/TestAppStats/Controller/Root.pm b/t/lib/TestAppStats/Controller/Root.pm
new file mode 100644 (file)
index 0000000..a46856a
--- /dev/null
@@ -0,0 +1,16 @@
+package TestAppStats::Controller::Root;
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+# Return log messages from previous request
+sub default : Private {
+    my ( $self, $c ) = @_;
+    $c->stats->profile("test");
+    $c->res->body(join("\n", @TestAppStats::log_messages));
+    @TestAppStats::log_messages = ();
+}
+
+1;