From: Yousef H. Alhashemi Date: Sun, 16 Aug 2009 18:08:03 +0000 (+0000) Subject: Returned the foo() action to TestAppPathBug.pm so it tests the right bug. Added a... X-Git-Tag: 5.80013~12^2~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=cb88f828a7fa6a90b46d1c7bca2d116820ea3d04 Returned the foo() action to TestAppPathBug.pm so it tests the right bug. Added a signal handler to silence the warning. Moved action methods from TestAppStats.pm to a root controller. --- diff --git a/t/lib/TestAppPathBug.pm b/t/lib/TestAppPathBug.pm index 04582a7..a91b5fe 100644 --- a/t/lib/TestAppPathBug.pm +++ b/t/lib/TestAppPathBug.pm @@ -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 index 6fda94e..0000000 --- a/t/lib/TestAppPathBug/Controller/Root.pm +++ /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; diff --git a/t/lib/TestAppStats.pm b/t/lib/TestAppStats.pm index bfc1340..6e3b320 100644 --- a/t/lib/TestAppStats.pm +++ b/t/lib/TestAppStats.pm @@ -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 index 0000000..a46856a --- /dev/null +++ b/t/lib/TestAppStats/Controller/Root.pm @@ -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;