Unit Tests

- Improved signal to noise ratio, which in this case helps with testing.
This commit is contained in:
Paul Beckingham
2011-09-11 01:03:51 -04:00
parent 038687b801
commit b0abe5a5ba

View File

@@ -28,7 +28,7 @@
use strict; use strict;
use warnings; use warnings;
use Test::More tests => 12; use Test::More tests => 7;
# Create the rc file. # Create the rc file.
if (open my $fh, '>', 'recur.rc') if (open my $fh, '>', 'recur.rc')
@@ -53,23 +53,13 @@ $output = qx{../src/task rc:recur.rc list};
like ($output, qr/and has been deleted/, 'Parent task deleted'); like ($output, qr/and has been deleted/, 'Parent task deleted');
# Cleanup. # Cleanup.
unlink 'pending.data'; unlink qw(pending.data completed.data undo.data backlog.data synch.key recur.rc);
ok (!-r 'pending.data', 'Removed pending.data'); ok (! -r 'pending.data' &&
! -r 'completed.data' &&
unlink 'completed.data'; ! -r 'undo.data' &&
ok (!-r 'completed.data', 'Removed completed.data'); ! -r 'backlog.data' &&
! -r 'synch.key' &&
unlink 'undo.data'; ! -r 'recur.rc', 'Cleanup');
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 'recur.rc';
ok (!-r 'recur.rc', 'Removed recur.rc');
exit 0; exit 0;