Unit Tests

- Updated a test to use a command of length >= rc.abbreviation.minimum.
- Removed useless setup/teardown tests.
This commit is contained in:
Paul Beckingham 2014-05-31 22:04:17 -04:00
parent 37acb90579
commit a86408c5a3

View file

@ -27,7 +27,7 @@
use strict; use strict;
use warnings; use warnings;
use Test::More tests => 21; use Test::More tests => 19;
# Ensure environment has no influence. # Ensure environment has no influence.
delete $ENV{'TASKDATA'}; delete $ENV{'TASKDATA'};
@ -39,7 +39,6 @@ if (open my $fh, '>', 'abbrev.rc')
print $fh "data.location=.\n", print $fh "data.location=.\n",
"abbreviation.minimum=1\n"; "abbreviation.minimum=1\n";
close $fh; close $fh;
ok (-r 'abbrev.rc', 'Created abbrev.rc');
} }
# Test the priority attribute abbrevations. # Test the priority attribute abbrevations.
@ -87,18 +86,12 @@ $output = qx{../src/task rc:abbrev.rc ver 2>&1};
like ($output, qr/MIT\s+license/, 'version'); like ($output, qr/MIT\s+license/, 'version');
$output = qx{../src/task rc:abbrev.rc ve 2>&1}; $output = qx{../src/task rc:abbrev.rc ve 2>&1};
like ($output, qr/MIT\s+license/, 'version'); unlike ($output, qr/MIT\s+license/, 'version');
$output = qx{../src/task rc:abbrev.rc v 2>&1}; $output = qx{../src/task rc:abbrev.rc v 2>&1};
like ($output, qr/MIT\s+license/, 'version'); unlike ($output, qr/MIT\s+license/, 'version');
# Cleanup. # Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data abbrev.rc); unlink qw(pending.data completed.data undo.data backlog.data abbrev.rc);
ok (! -r 'pending.data' &&
! -r 'completed.data' &&
! -r 'undo.data' &&
! -r 'backlog.data' &&
! -r 'abbrev.rc', 'Cleanup');
exit 0; exit 0;