Trog-Renderer.t 596 B

1234567891011121314151617181920
  1. #!/usr/bin/env perl
  2. use 5.040;
  3. use re '/aasx';
  4. use warnings FATAL => 'all';
  5. use Test::More;
  6. use Test::Fatal qw{exception};
  7. use FindBin::libs;
  8. require_ok('Trog::Renderer') or BAIL_OUT("Can't find SUT");
  9. subtest 'a render that fails, and an error page that fails too' => sub {
  10. my $err = exception {
  11. Trog::Renderer->render( contenttype => 'text/html', component => 1, template => 'bogus-nothere.tx', data => {} );
  12. };
  13. like( $err, qr/Could[ ]not[ ]render[ ]template[ ]'bogus-nothere[.]tx'/, 'dies with the reason, for data that names no method or route' );
  14. };
  15. done_testing();