Skip to content

Commit

Permalink
added test for exception in helper
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 6, 2013
1 parent 4d33623 commit 489f0a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

4.12 2013-06-05
4.12 2013-06-06

4.11 2013-06-03
- Added allow and append methods to Mojo::Headers.
Expand Down
10 changes: 10 additions & 0 deletions t/mojolicious/exception_lite_app.t
Expand Up @@ -19,6 +19,8 @@ app->log->level($ENV{MOJO_LOG_LEVEL} = 'debug');
my $log = '';
app->log->on(message => sub { shift; $log .= join ':', @_ });

helper dead_helper => sub { die "dead helper!\n" };

get '/logger' => sub {
my $self = shift;
my $level = $self->param('level');
Expand Down Expand Up @@ -92,6 +94,8 @@ get '/reuse/exception' => {foo => 'bar'} =>

get '/custom' => sub { die "CUSTOM\n" };

get '/dead_helper';

my $t = Test::Mojo->new;

# Debug
Expand Down Expand Up @@ -172,6 +176,9 @@ $t->get_ok('/trapped/too')->status_is(200)->content_is('works');
# Custom exception handling
$t->get_ok('/custom')->status_is(200)->content_is('Custom handling works!');

# Exception in helper
$t->get_ok('/dead_helper')->status_is(500)->content_like(qr/dead helper!/);

# Missing template
$t->get_ok('/missing_template')->status_is(404)
->content_type_is('text/html;charset=UTF-8')
Expand Down Expand Up @@ -243,3 +250,6 @@ works!
@@ not_found.development.xml.ep
<somewhat>bad</somewhat>
@@ dead_helper.html.ep
% dead_helper;

0 comments on commit 489f0a6

Please sign in to comment.