From: Christian Hansen Date: Wed, 13 Apr 2005 08:53:28 +0000 (+0000) Subject: fixed warnings in tests X-Git-Tag: 5.7099_04~1551 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=c462faf09f20b2fca60bb9c63bf30b158760aa2c fixed warnings in tests --- diff --git a/lib/Catalyst/Engine/Test.pm b/lib/Catalyst/Engine/Test.pm index 143414e..d5fb8a7 100644 --- a/lib/Catalyst/Engine/Test.pm +++ b/lib/Catalyst/Engine/Test.pm @@ -126,7 +126,7 @@ sub prepare_parameters { my $upload = Catalyst::Request::Upload->new( filename => $parameters{filename}, - size => ( stat $fh )[7], + size => ( $fh->stat )[7], tempname => $fh->filename, type => $part->content_type ); diff --git a/lib/Catalyst/Manual/Intro.pod b/lib/Catalyst/Manual/Intro.pod index 0ee9174..c25b9ff 100644 --- a/lib/Catalyst/Manual/Intro.pod +++ b/lib/Catalyst/Manual/Intro.pod @@ -237,7 +237,7 @@ The last of these, the stash, is a universal hash for sharing data among applica $c->forward('show-message'); } - show-message : Private { + sub show-message : Private { my ( $self, $c ) = @_; $c->res->output( $c->stash->{message} ); } diff --git a/lib/Catalyst/Request/Upload.pm b/lib/Catalyst/Request/Upload.pm index 867c098..5df78ee 100644 --- a/lib/Catalyst/Request/Upload.pm +++ b/lib/Catalyst/Request/Upload.pm @@ -44,8 +44,8 @@ Copies tempname using C. Returns true for success, false otherwise. =cut sub copy_to { - my ( $self, $target, $buffer ) = @_; - return File::Copy::copy( $self->tempname, $target, $buffer ); + my $self = shift; + return File::Copy::copy( $self->tempname, @_ ); } =item $upload->fh diff --git a/t/lib/Catalyst/Plugin/Test/Errors.pm b/t/lib/Catalyst/Plugin/Test/Errors.pm index 3365e2f..4dc0d57 100644 --- a/t/lib/Catalyst/Plugin/Test/Errors.pm +++ b/t/lib/Catalyst/Plugin/Test/Errors.pm @@ -6,7 +6,7 @@ sub error { my $c = shift; unless ( $_[0] ) { - $c->NEXT::error(@_); + return $c->NEXT::error(@_); } if ( $_[0] =~ /^(Unknown resource|No default action defined)/ ) { diff --git a/t/lib/TestApp/Controller/Action/Forward.pm b/t/lib/TestApp/Controller/Action/Forward.pm index ec3631a..44d0bad 100644 --- a/t/lib/TestApp/Controller/Action/Forward.pm +++ b/t/lib/TestApp/Controller/Action/Forward.pm @@ -34,4 +34,11 @@ sub jojo : Relative { $c->forward('three'); } + +sub inheritance : Relative { + my ( $self, $c ) = @_; + $c->forward('engine/response/cookies/one'); + $c->forward('five'); +} + 1; diff --git a/t/lib/TestApp/Controller/Engine/Response/Errors.pm b/t/lib/TestApp/Controller/Engine/Response/Errors.pm index 63c3f35..7e60a7f 100644 --- a/t/lib/TestApp/Controller/Engine/Response/Errors.pm +++ b/t/lib/TestApp/Controller/Engine/Response/Errors.pm @@ -7,7 +7,7 @@ sub one : Relative { my ( $self, $c ) = @_; my $a = 0; my $b = 0; - my $c = $a / $b; + my $t = $a / $b; } sub two : Relative {