Skip to content

Commit

Permalink
use a better error message for mode specific tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 26, 2016
1 parent 0a58220 commit 3cd17df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lib/Mojolicious/Guides/FAQ.pod
Expand Up @@ -75,11 +75,11 @@ for it, this is currently 5.10.1.
=head2 Do I need to clean my environment before testing Mojolicious?

Mojolicious uses many environment variables both internally and externally,
notably (but not exclusively) those starting with the prefix C<MOJO_*>. The
test suite expects a clean environment; testing with a non-standard environment
is unsupported and is unlikely to succeed. Therefore when installing or
upgrading L<Mojolicious> and when running its tests, we highly recommend using
an environment which does not set these variables.
notably (but not exclusively) those starting with the prefix C<MOJO_*> and
L<PLACK_ENV>. The test suite expects a clean environment; testing with a
non-standard environment is unsupported and is unlikely to succeed. Therefore
when installing or upgrading L<Mojolicious> and when running its tests, we
highly recommend using an environment which does not set these variables.

=head2 What is the difference between blocking and non-blocking operations?

Expand Down
10 changes: 5 additions & 5 deletions t/mojolicious/production_app.t
Expand Up @@ -52,27 +52,27 @@ $t->get_ok('/plugin-test-some_plugin2/register')->status_isnt(500)
# SyntaxError::foo in production mode (syntax error in controller)
$t->get_ok('/syntax_error/foo')->status_is(500)
->header_is(Server => 'Mojolicious (Perl)')
->content_like(qr/Internal Server Error/);
->content_like(qr/Not development mode error!/);

# Foo::syntaxerror in production mode (syntax error in template)
$t->get_ok('/foo/syntaxerror')->status_is(500)
->header_is(Server => 'Mojolicious (Perl)')
->content_like(qr/Internal Server Error/);
->content_like(qr/Not development mode error!/);

# Exceptional::this_one_dies (action dies)
$t->get_ok('/exceptional/this_one_dies')->status_is(500)
->header_is(Server => 'Mojolicious (Perl)')
->content_like(qr/Internal Server Error/);
->content_like(qr/Not development mode error!/);

# Exceptional::this_one_might_die (bridge dies)
$t->get_ok('/exceptional_too/this_one_dies')->status_is(500)
->header_is(Server => 'Mojolicious (Perl)')
->content_like(qr/Internal Server Error/);
->content_like(qr/Not development mode error!/);

# Exceptional::this_one_might_die (action dies)
$t->get_ok('/exceptional_too/this_one_dies' => {'X-DoNotDie' => 1})
->status_is(500)->header_is(Server => 'Mojolicious (Perl)')
->content_like(qr/Internal Server Error/);
->content_like(qr/Not development mode error!/);

# Exceptional::this_one_does_not_exist (action does not exist)
$t->get_ok('/exceptional/this_one_does_not_exist')->status_is(404)
Expand Down
2 changes: 1 addition & 1 deletion t/mojolicious/templates/exception.html.epl
Expand Up @@ -3,5 +3,5 @@
%= $self->stash('exception')->message
% }
% else {
Internal Server Error
Not development mode error!
% }

0 comments on commit 3cd17df

Please sign in to comment.