From f7bc0cb1fa77b34187f92b486733529a6124e2cf Mon Sep 17 00:00:00 2001 From: tetragon Date: Sat, 2 Jun 2007 23:12:01 +0000 Subject: Template test adjustments git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1251 4979c152-3d1c-0410-bac9-87ea11338e46 --- t/04-template-handling.t | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 't/04-template-handling.t') diff --git a/t/04-template-handling.t b/t/04-template-handling.t index 0e2f52bb..1f05a266 100644 --- a/t/04-template-handling.t +++ b/t/04-template-handling.t @@ -3,8 +3,8 @@ use strict; use warnings; -#$ENV{TMPDIR} = 't/var'; -$ENV{TMPDIR} = '/Users/seneca/sourceforge-svn/ledger-smb/trunk/t/var'; +# Absolute directory name required to not trip up Template::Latex +$ENV{TMPDIR} = "$ENV{PWD}/t/var"; use Test::More 'no_plan'; use Test::Trap qw(trap $trap); @@ -226,6 +226,10 @@ is($template->{include_path}, 't/data', is($template->render({'login' => 'foo\&bar'}), 't/var/04-template-output.pdf', 'Template, render: Simple PDF template, default filename'); ok(-e 't/var/04-template-output.pdf', 'Template, render (PDF): File created'); +is(unlink('t/var/04-template-output.pdf'), 1, + 'Template, render (PDF): removing testfile'); +ok(!-e 't/var/04-template-output.pdf', + 'Template, render (PDF): testfile removed'); $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'PS', @@ -239,6 +243,10 @@ is($template->{include_path}, 't/data', is($template->render({'login' => 'foo\&bar'}), 't/var/04-template-output.ps', 'Template, render: Simple Postscript template, default filename'); ok(-e 't/var/04-template-output.ps', 'Template, render (PS): File created'); +is(unlink('t/var/04-template-output.ps'), 1, + 'Template, render (PS): removing testfile'); +ok(!-e 't/var/04-template-output.ps', + 'Template, render (PS): testfile removed'); ##open($FH, '<', 't/var/04-template-output.html'); ##@r = <$FH>; ##close($FH); -- cgit v1.2.3