From: John Napiorkowski Date: Wed, 12 Jun 2013 16:26:22 +0000 (-0400) Subject: fix broken tests X-Git-Tag: 5.90040~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=ade3da0a3602627512932eef9af511247f11634f;hp=409d48fb495802db8eb6e02a927dd2915d8643b4 fix broken tests --- diff --git a/Changes b/Changes index 1d75d76..680dd03 100644 --- a/Changes +++ b/Changes @@ -22,7 +22,9 @@ TBA you should remove it from your plugin list, HOWEVER the 'encoding' config setting is now undef, rather than 'UTF-8' (this was done to avoid breaking people's existing applications) so you should add the encoding setting to - you global config (See Catalyst::Upgrading for more). + you global config. There's some other changes between the stand alone + plugin and the cored version, if you use it be sure to see Catalyst::Upgrading + for more. - minor documentation typo fixes and updates 5.90030 - 2013-04-12 diff --git a/Makefile.PL b/Makefile.PL index b50b74f..d5fa8c5 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -82,6 +82,7 @@ test_requires 'Data::Dump'; test_requires 'HTTP::Request::Common'; test_requires 'IO::Scalar'; test_requires 'HTTP::Status'; +test_requires 'Catalyst::Plugin::Params::Nested'; # aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate and a Test::Simple it works with is available my @author_requires; diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 17605d4..ccd5e23 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -3193,7 +3193,7 @@ is having paths rewritten into it (e.g. as a .cgi/fcgi in a public_html director at other URIs than that which the app is 'normally' based at with C), the resolution of C<< $c->request->base >> will be incorrect. -=back +=back =item * @@ -3203,9 +3203,9 @@ C - See L. C - See L -=back +=item * -=item abort_chain_on_error_fix => 1 +C When there is an error in an action chain, the default behavior is to continue processing the remaining actions and then catch the error upon chain end. This @@ -3214,8 +3214,14 @@ you have this issue, setting this config value to true will promptly exit a chain when there is an error raised in any action (thus terminating the chain early.) +use like: + + __PACKAGE__->config(abort_chain_on_error_fix => 1); + In the future this might become the default behavior. +=back + =head1 INTERNAL ACTIONS Catalyst uses internal actions like C<_DISPATCH>, C<_BEGIN>, C<_AUTO>, diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index 17f0be9..f75319b 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -97,12 +97,22 @@ has io_fh => ( lazy=>1, builder=>'_build_io_fh'); - sub _build_io_fh { +sub _build_io_fh { my $self = shift; return $self->env->{'psgix.io'} || die "Your Server does not support psgix.io"; - }; +}; +has body_fh => ( + is=>'ro', + predicate=>'has_body_fh', + lazy=>1, + builder=>'_build_body_fh'); + +sub _build_body_fh { + (my $input_fh = shift->env->{'psgi.input'})->seek(0, 0); + return $input_fh; +}; # Amount of data to read from input on each pass our $CHUNKSIZE = 64 * 1024; diff --git a/lib/Catalyst/Upgrading.pod b/lib/Catalyst/Upgrading.pod index 7d45923..bce2a14 100644 --- a/lib/Catalyst/Upgrading.pod +++ b/lib/Catalyst/Upgrading.pod @@ -32,6 +32,12 @@ UTF-8. We'll add it for you if you continue to use the stand alone plugin and we detect this, but this backwards compatibility shim will likely be removed in a few releases (trying to clean up the codebase after all). +B: One other difference between the cored plugin and the stand alone one +is that in core we no longer throw an exception when there's a decode failure +but instead log a warning. If you rely on exceptions for control flow, you +will need to override method C to die instead +of warning. Please let the dev team know if this is a problem for you. + If you have trouble with any of this, please bring it to the attention of the Catalyst maintainer group. diff --git a/t/author/spelling.t b/t/author/spelling.t index 465c5eb..37cea27 100644 --- a/t/author/spelling.t +++ b/t/author/spelling.t @@ -19,6 +19,7 @@ add_stopwords(qw( inline INLINE plugins cpanfile FastCGI Stringifies Rethrows DispatchType Wishlist Refactor ROADMAP HTTPS Unescapes Restarter Nginx Refactored ActionClass LocalRegex LocalRegexp MyAction metadata cometd io psgix websockets + UTF async codebase dev filenames params Andreas Ashton Axel