mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +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 => 3;
|
||||
use Test::More tests => 4;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'bug.rc')
|
||||
|
@ -45,7 +45,8 @@ if (open my $fh, '>', 'bug.rc')
|
|||
qx{../src/task rc:bug.rc add Test 2>&1};
|
||||
|
||||
# Result: Attempt to undo add with confirmation=off
|
||||
my $output = qx{echo 'n' |../src/task rc:bug.rc rc.confirmation=off undo 2>&1};
|
||||
my $output = qx{echo 'n' | ../src/task rc:bug.rc rc.confirmation=off undo 2>&1};
|
||||
like ($output, qr/^Task removed.$/ms, 'Task removed.');
|
||||
unlike ($output, qr/Are you sure/ms, 'Undo honours confirmation=off.');
|
||||
|
||||
# Cleanup.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue