mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Improved verbosity unit tests.
This commit is contained in:
parent
7fe5fc80e9
commit
26cc4e11f5
1 changed files with 11 additions and 14 deletions
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 10;
|
use Test::More tests => 8;
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'verbose.rc')
|
if (open my $fh, '>', 'verbose.rc')
|
||||||
|
@ -39,28 +39,25 @@ if (open my $fh, '>', 'verbose.rc')
|
||||||
ok (-r 'verbose.rc', 'Created verbose.rc');
|
ok (-r 'verbose.rc', 'Created verbose.rc');
|
||||||
}
|
}
|
||||||
|
|
||||||
# Verbosity: 'affected'
|
|
||||||
my $output = qx{../src/task rc:verbose.rc log foo rc.verbose:on};
|
|
||||||
like ($output, qr/Logged task/, '\'affected\' verbosity good');
|
|
||||||
|
|
||||||
$output = qx{../src/task rc:verbose.rc log bar rc.verbose:off};
|
|
||||||
unlike ($output, qr/Logged task/, '\'affected\' verbosity good');
|
|
||||||
|
|
||||||
# Verbosity: 'new-id'
|
# Verbosity: 'new-id'
|
||||||
$output = qx{../src/task rc:verbose.rc rc.verbose:on add Sample1};
|
my $output = qx{../src/task rc:verbose.rc rc.verbose:new-id add Sample1};
|
||||||
like ($output, qr/Created task \d/, '\'new-id\' verbosity good');
|
like ($output, qr/Created task \d/, '\'new-id\' verbosity good');
|
||||||
|
|
||||||
$output = qx{../src/task rc:verbose.rc rc.verbose:off add Sample2};
|
$output = qx{../src/task rc:verbose.rc rc.verbose:off add Sample2};
|
||||||
unlike ($output, qr/Created task \d/, '\'new-id\' verbosity good');
|
unlike ($output, qr/Created task \d/, '\'new-id\' verbosity good');
|
||||||
|
|
||||||
# Verbosity: 'label', 'footer'
|
# Verbosity: 'label'
|
||||||
$output = qx{../src/task rc:verbose.rc ls rc.verbose:on};
|
$output = qx{../src/task rc:verbose.rc ls rc.verbose:label};
|
||||||
like ($output, qr/ID.+Project.+Pri.+Description/, '\'label\' verbosity good');
|
like ($output, qr/ID.+Project.+Pri.+Description/, '\'label\' verbosity good');
|
||||||
like ($output, qr/^\d+ tasks$/ms, '\'footer\' verbosity good');
|
|
||||||
|
|
||||||
$output = qx{../src/task rc:verbose.rc list rc.verbose:off};
|
# Verbosity: 'affected'
|
||||||
|
$output = qx{../src/task rc:verbose.rc ls rc.verbose:affected};
|
||||||
|
like ($output, qr/^\d+ tasks$/ms, '\'affected\' verbosity good');
|
||||||
|
|
||||||
|
# Off
|
||||||
|
$output = qx{../src/task rc:verbose.rc ls rc.verbose:off};
|
||||||
|
unlike ($output, qr/^\d+ tasks$/ms, '\'affected\' verbosity good');
|
||||||
unlike ($output, qr/ID.+Project.+Pri.+Description/, '\'label\' verbosity good');
|
unlike ($output, qr/ID.+Project.+Pri.+Description/, '\'label\' verbosity good');
|
||||||
unlike ($output, qr/^\d+ tasks$/ms, '\'footer\' verbosity good');
|
|
||||||
|
|
||||||
# TODO Verbosity: 'blank'
|
# TODO Verbosity: 'blank'
|
||||||
# TODO Verbosity: 'header'
|
# TODO Verbosity: 'header'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue