Unit Tests
- More robust tests strategy: captured outputs are always compared to some expected result. - Clearer and more consistent test. Signed-off-by: Paul Beckingham <paul@beckingham.net>
This commit is contained in:
committed by
Paul Beckingham
parent
ee7fd7add0
commit
a0d6b3198e
@@ -28,7 +28,7 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 3;
|
||||
use Test::More tests => 4;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'bug.rc')
|
||||
@@ -53,7 +53,8 @@ qx{../src/task rc:bug.rc ls 2>&1};
|
||||
|
||||
# Result: Check for an extra task the second time task ls is executed
|
||||
my $output = qx{../src/task rc:bug.rc ls 2>&1};
|
||||
unlike ($output, qr/^\s3\s*Second recurring task\s*$/ms, 'Extra task detected.');
|
||||
like ($output, qr/^2 tasks$/ms, '2 tasks shown.');
|
||||
unlike ($output, qr/^\s3\s*Second recurring task\s*$/ms, 'Extra task detected.');
|
||||
|
||||
# Cleanup.
|
||||
unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc);
|
||||
|
||||
Reference in New Issue
Block a user