X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fdispatch_misc.t;h=a4ab38a7366c490e85d8b124c97849f13740746a;hb=e0f92e3eb7f7176e4d6cdaa4c721e3b6d40b8249;hp=842cf52883bf9b05aa1d824d8c98f819efb5aa11;hpb=c6ce65ac85c6441b93532f7d51a520b12c4c8f66;p=catagits%2FWeb-Simple.git diff --git a/t/dispatch_misc.t b/t/dispatch_misc.t index 842cf52..a4ab38a 100644 --- a/t/dispatch_misc.t +++ b/t/dispatch_misc.t @@ -126,12 +126,22 @@ sub invalid_psgi_responses { for my $response ( @responses ) { @dispatch = ( sub (/) { $response->[0] } ); - eval { run_request( GET => 'http://localhost/' ) }; - - like $@, qr/Can't call method "request" on an undefined value .*MockHTTP/, - sprintf( + my $message = sprintf( "if a route returns %s, then that is returned as a response by WD, causing HTTP::Message::PSGI to choke", - $response->[1] ); + $response->[1] + ); + + # Somewhere between 1.0028 and 1.0031 Plack changed so that the + # FauxObject case became a 500 rather than a die; in case it later does + # the same thing for other stuff, just accept either sort of error + + my $res = eval { run_request( GET => 'http://localhost/' ) }; + + if ($res) { + ok $res->is_error, $message; + } else { + like $@, qr/Can't call method "request" on an undefined value .*MockHTTP/, $message; + } undef $@; } }