Unit testing a custom tt plugin

"Tom Green" <[email protected]> Fri, 16 Jan 2015 12:48:32 -0600
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <[email protected]>
This is a multipart message in MIME format.

--===============7836951569733956188==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_04CC_01D0318A.BC356C50"
Content-Language: en-us

This is a multipart message in MIME format.

------=_NextPart_000_04CC_01D0318A.BC356C50
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

I wrote a custom template toolkit plugin and was looking for the best way to
write the unit tests for it.

 

Does anyone have suggestions? Or a good example on the web somewhere. Google
was no help.

 

I looked at the unit test framework in Template::Test, but didn't find any
that use mocking which I need since my plugin loads data and I want to
replace that with a specific set in my plugin unit tests.

 

Any help would be appreciated.

 

Tom


------=_NextPart_000_04CC_01D0318A.BC356C50
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 14 =
(filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue =
vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>I wrote a =
custom template toolkit plugin and was looking for the best way to write =
the unit tests for it.<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Does anyone =
have suggestions? Or a good example on the web somewhere. Google was no =
help.<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>I looked at the unit test framework in Template::Test, =
but didn&#8217;t find any that use mocking which I need since my plugin =
loads data and I want to replace that with a specific set in my plugin =
unit tests.<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>Any help would be appreciated.<o:p></o:p></p><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p =
class=3DMsoNormal>Tom<o:p></o:p></p></div></body></html>
------=_NextPart_000_04CC_01D0318A.BC356C50--



--===============7836951569733956188==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

--===============7836951569733956188==--