Advertisement
Guest User

Untitled

a guest
Aug 24th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.69 KB | None | 0 0
  1. use strict;
  2. use warnings;
  3. use Test::More tests => 3;
  4. use Test::Mojo;
  5.  
  6. use Mojolicious::Lite;
  7.  
  8. # Tell Mojolicious we want to load the TT renderer plugin
  9. app->plugin(
  10.     tt_renderer => {
  11.         template_options => {
  12.             # These options are specific to TT
  13.             INCLUDE_PATH => 'templates',
  14.             COMPILE_DIR  => 'templates_c',
  15.             COMPILE_EXT  => '.ttc',
  16.             # ... anything else to be passed on to TT should go here
  17.         },
  18.     }
  19. );
  20.  
  21. app->renderer->default_handler('tt');
  22.  
  23. get '/' => sub {
  24.     die 'foo';
  25. };
  26.  
  27. my $t = Test::Mojo->new;
  28.  
  29. $t->get_ok('/')
  30.     ->status_is(500)
  31.     ->content_isnt('');
  32.  
  33. __DATA__
  34.  
  35. @@ index.html.tt
  36. anything
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement