Unit Tests

- Removed useless setup/teardown tests, improving the signal to noise ratio.
This commit is contained in:
Paul Beckingham 2014-06-01 09:51:25 -04:00
parent 7ab8d4db6d
commit 0a1bcbd48d
4 changed files with 5 additions and 33 deletions

View file

@ -27,7 +27,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 3;
# Ensure environment has no influence.
delete $ENV{'TASKDATA'};
@ -39,7 +39,6 @@ if (open my $fh, '>', 'recur.rc')
print $fh "data.location=.\n",
"defaultwidth=100\n";
close $fh;
ok (-r 'recur.rc', 'Created recur.rc');
}
# Add a recurring task, then see how many future pending tasks are
@ -58,11 +57,5 @@ like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected');
# Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
ok (! -r 'pending.data' &&
! -r 'completed.data' &&
! -r 'undo.data' &&
! -r 'backlog.data' &&
! -r 'recur.rc', 'Cleanup');
exit 0;

View file

@ -27,7 +27,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 3;
# Ensure environment has no influence.
delete $ENV{'TASKDATA'};
@ -42,7 +42,6 @@ if (open my $fh, '>', 'recur.rc')
"report.desc.columns=id,recur,description\n",
"report.desc.sort=recur-\n";
close $fh;
ok (-r 'recur.rc', 'Created recur.rc');
}
# Create a few recurring tasks, and test the sort order of the recur column.
@ -61,11 +60,5 @@ like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected');
# Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
ok (! -r 'pending.data' &&
! -r 'completed.data' &&
! -r 'undo.data' &&
! -r 'backlog.data' &&
! -r 'recur.rc', 'Cleanup');
exit 0;

View file

@ -27,7 +27,7 @@
use strict;
use warnings;
use Test::More tests => 11;
use Test::More tests => 9;
# Ensure environment has no influence.
delete $ENV{'TASKDATA'};
@ -40,7 +40,6 @@ if (open my $fh, '>', 'recur.rc')
"confirmation=off\n",
"recurrence.limit=1\n";
close $fh;
ok (-r 'recur.rc', 'Created recur.rc');
}
# Create a recurring and non-recurring task.
@ -98,11 +97,5 @@ like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected');
# Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
ok (! -r 'pending.data' &&
! -r 'completed.data' &&
! -r 'undo.data' &&
! -r 'backlog.data' &&
! -r 'recur.rc', 'Cleanup');
exit 0;

View file

@ -27,7 +27,7 @@
use strict;
use warnings;
use Test::More tests => 5;
use Test::More tests => 3;
# Ensure environment has no influence.
delete $ENV{'TASKDATA'};
@ -38,7 +38,6 @@ if (open my $fh, '>', 'recur.rc')
{
print $fh "data.location=.\n";
close $fh;
ok (-r 'recur.rc', 'Created recur.rc');
}
# Create a few recurring tasks, and test the sort order of the recur column.
@ -49,7 +48,7 @@ like ($output, qr/one/, 'recur weekdays');
$output = qx{../src/task rc:recur.rc info 1 2>&1};
like ($output, qr/Recurrence\s+weekdays/, 'task recurs every weekday');
qx{../src/task rc:recur.rc 1 do 2>&1};
qx{../src/task rc:recur.rc 1 done 2>&1};
$output = qx{../src/task rc:recur.rc list 2>&1};
$output = qx{../src/task rc:recur.rc diag 2>&1};
@ -57,11 +56,5 @@ like ($output, qr/No duplicates found/, 'No duplicate UUIDs detected');
# Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data recur.rc);
ok (! -r 'pending.data' &&
! -r 'completed.data' &&
! -r 'undo.data' &&
! -r 'backlog.data' &&
! -r 'recur.rc', 'Cleanup');
exit 0;