Change to use relative paths, add exception template for tests

This commit is contained in:
Marcus Ramberg committed 2011-02-06 08:50:02 +01:00
1 parent fc453fe4fb
commit 323d5a9294
4 files changed
+18 -11

No files matched your search

+3 -1
View File
@@ -3,6 +3,8 @@
use strict;
use warnings;
BEGIN { $ENV{MOJO_MODE}='testing'; };
use utf8;
use Test::More tests => 31;
@@ -45,7 +47,7 @@ get '/inline' => sub { shift->render(inline => '[% 1 + 1 %]', handler => 'tt') }
my $t = Test::Mojo->new;
# Exception
$t->get_ok('/exception')->status_is(500)->content_like(qr/error/i);
$t->get_ok('/exception')->status_is(500)->content_like(qr/Exception/i);
# Normal rendering
$t->get_ok('/bar/hello')->content_is("hello");
+8
View File
@@ -0,0 +1,8 @@
% my $s = $self->stash;
% my $e = $self->stash('exception');
% delete $s->{inner_template};
% delete $s->{exception};
% my $dump = dumper $s;
% $s->{exception} = $e;
An Exception has occured: <%= $e->message %>
at <%= $e->line->[0] %> in <%= $e->line->[1] %>