Caleb Cushing's Blog Also known as XenoTerraCide
Posts with the tag TT:

Testing TT Template's

So the poorly made patch the other day converted my Test::More test to use Template::Testwhich removed quite a bit of code from the test itself. I hadn’t seen Template::Test beforehand.Here’s a very simple example of a test you could write to make sure a template is being output ok.#!perluse strict;use warnings;use Template::Test;my $tt = Template->new();my $vars = {var => ‘world’,};test_expect(*DATA, $tt, $vars);DATA–test–hello [% var %]–expect–hello worldIf you want more examples I now have quite a few for Template::ShowStartStopwhich you can see in the Test directory of the master branch.