mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 19:03:07 +02:00
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:
parent
ee7fd7add0
commit
a0d6b3198e
16 changed files with 67 additions and 35 deletions
|
@ -28,7 +28,7 @@
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 5;
|
||||
use Test::More tests => 6;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'bug.rc')
|
||||
|
@ -47,13 +47,14 @@ if (open my $fh, '>', 'bug.rc')
|
|||
qx{../src/task rc:bug.rc add des 2>&1};
|
||||
qx{../src/task rc:bug.rc 1 annotate des 2>&1};
|
||||
my $output = qx{../src/task rc:bug.rc 1 info 2>&1};
|
||||
like ($output, qr/^Description\s+des$/ms, 'Attribute not completed in description');
|
||||
unlike ($output, qr/description/ms, 'Attribute not completed in description');
|
||||
|
||||
# Check that the completion works when needed
|
||||
$output = qx{../src/task rc:bug.rc des:des 2>&1};
|
||||
unlike ($output, qr/No matches./ms, 'Task found using its description');
|
||||
like ($output, qr/^1 task.$/ms, 'Task found using its description');
|
||||
|
||||
$output = qx{../src/task rc:bug.rc add entrée interdite 2>&1};
|
||||
qx{../src/task rc:bug.rc add entrée interdite 2>&1};
|
||||
$output = qx{../src/task rc:bug.rc list interdite 2>&1};
|
||||
like ($output, qr/entrée interdite/, "'entrée' left intact");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue