Tests for plugin

This commit is contained in:
Marcus Ramberg
2010-03-05 16:36:00 +08:00
committed by Ask Bjørn Hansen
parent 0588884a9f
commit c3e8c9ff73
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1 @@
test123[% 456 %]

39
t/tt_plugin_lite_app.t Normal file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env perl
# Copyright (C) 2008-2010, Sebastian Riedel.
use strict;
use warnings;
use File::Temp;
use Mojo::IOLoop;
use Test::More;
# Use a clean temporary directory
BEGIN { $ENV{MOJO_TMPDIR} ||= File::Temp::tempdir }
# Make sure sockets are working
plan skip_all => 'working sockets required for this test!'
unless Mojo::IOLoop->new->generate_port;
plan tests => 3;
# Leela: OK, this has gotta stop. I'm going to remind Fry of his humanity the way only a woman can.
# Farnsworth: You're going to do his laundry?
use Mojolicious::Lite;
use Test::Mojo;
# POD renderer plugin
plugin 'tt_renderer';
# Silence
app->log->level('error');
# GET /
get '/' => 'index';
my $t = Test::Mojo->new;
# Simple TT template
$t->get_ok('/')->status_is(200)
->content_like(qr/test123456/);