Unit Tests

- Improved the signal to noise ration for more unit tests.
This commit is contained in:
Paul Beckingham 2011-09-03 16:25:48 -04:00
parent 1691ce2764
commit 2b7c2f6a21
2 changed files with 17 additions and 36 deletions

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 13;
use Test::More tests => 8;
# Create the rc file.
if (open my $fh, '>', 'projects.rc')
@ -43,6 +43,7 @@ if (open my $fh, '>', 'projects.rc')
qx{../src/task rc:projects.rc add project:p1 one};
qx{../src/task rc:projects.rc add project:p2 two};
qx{../src/task rc:projects.rc 1 done};
my $output = qx{../src/task rc:projects.rc ls};
unlike ($output, qr/p1/, 'p1 done');
like ($output, qr/p2/, 'p2 pending');
@ -56,23 +57,13 @@ like ($output, qr/p1/, 'p1 listed');
like ($output, qr/p2/, 'p2 listed');
# Cleanup.
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');
unlink 'completed.data';
ok (!-r 'completed.data', 'Removed completed.data');
unlink 'undo.data';
ok (!-r 'undo.data', 'Removed undo.data');
unlink 'backlog.data';
ok (!-r 'backlog.data', 'Removed backlog.data');
unlink 'synch.key';
ok (!-r 'synch.key', 'Removed synch.key');
unlink 'projects.rc';
ok (!-r 'projects.rc', 'Removed projects.rc');
unlink qw(pending.data completed.data undo.data backlog.data synch.key projects.rc);
ok (! -r 'pending.data' &&
! -r 'completed.data' &&
! -r 'undo.data' &&
! -r 'backlog.data' &&
! -r 'synch_key.data' &&
! -r 'projects.rc', 'Cleanup');
exit 0;