Unit Tests

- Upgraded to use the new template.
This commit is contained in:
Paul Beckingham 2014-08-24 21:22:04 -04:00
parent f7b5ba2312
commit e077b5bd34

View file

@ -33,8 +33,12 @@ use Test::More tests => 2;
delete $ENV{'TASKDATA'}; delete $ENV{'TASKDATA'};
delete $ENV{'TASKRC'}; delete $ENV{'TASKRC'};
use File::Basename;
my $ut = basename ($0);
my $rc = $ut . '.rc';
# Create the rc file. # Create the rc file.
if (open my $fh, '>', 'bug.rc') if (open my $fh, '>', $rc)
{ {
print $fh "data.location=.\n"; print $fh "data.location=.\n";
close $fh; close $fh;
@ -46,11 +50,11 @@ if (open my $fh, '>', 'pending.data')
close $fh; close $fh;
} }
my $output = qx{../src/task rc:bug.rc list 2>&1}; my $output = qx{../src/task rc:$rc list 2>&1};
like ($output, qr/One/, 'task listed'); like ($output, qr/One/, "$ut: task listed");
unlike ($output, qr/The recurrence value '1m' is not valid\./, 'recu:1m => no error'); unlike ($output, qr/The recurrence value '1m' is not valid\./, "$ut: recu:1m => no error");
# Cleanup. # Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data bug.rc); unlink qw(pending.data completed.data undo.data backlog.data), $rc;
exit 0; exit 0;