Unit Tests

- Added unit tests to verify that appending or prepending nothing
  generates an error.
This commit is contained in:
Paul Beckingham 2011-05-21 10:35:46 -04:00
parent bb24701f36
commit df652d2ec7
2 changed files with 11 additions and 3 deletions

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 6;
use Test::More tests => 7;
# Create the rc file.
if (open my $fh, '>', 'prepend.rc')
@ -44,6 +44,10 @@ qx{../src/task rc:prepend.rc 1 prepend foo};
my $output = qx{../src/task rc:prepend.rc info 1};
like ($output, qr/Description\s+foo\sbar\n/, 'prepend worked');
# Should cause an error when nothing is appended.
$output = qx{../src/task rc:prepend.rc prepend 1};
unlike ($output, qr/Prepended 0 tasks/, 'blank prepend failed');
# Cleanup.
unlink 'pending.data';
ok (!-r 'pending.data', 'Removed pending.data');