mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Upgraded to use the new template.
This commit is contained in:
parent
7488d464fc
commit
333fd945f6
1 changed files with 11 additions and 7 deletions
|
@ -33,8 +33,12 @@ use Test::More tests => 3;
|
|||
delete $ENV{'TASKDATA'};
|
||||
delete $ENV{'TASKRC'};
|
||||
|
||||
use File::Basename;
|
||||
my $ut = basename ($0);
|
||||
my $rc = $ut . '.rc';
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'bug.rc')
|
||||
if (open my $fh, '>', $rc)
|
||||
{
|
||||
print $fh "data.location=.\n",
|
||||
"confirmation=off\n";
|
||||
|
@ -45,12 +49,12 @@ if (open my $fh, '>', 'bug.rc')
|
|||
# - showing the list of default configuration variables
|
||||
# - checking that there is no error, no deprecated variable and no unrecognized variables
|
||||
|
||||
qx{../src/task rc:bug.rc add foo 2>&1};
|
||||
my $output = qx{../src/task rc:bug.rc show 2>&1};
|
||||
like ($output, qr/^Config Variable\s+Value$/m, 'Variables shown');
|
||||
unlike ($output, qr/Configuration error/ms, 'No configuration error');
|
||||
unlike ($output, qr/unrecognized/ms, 'No unrecognized variable');
|
||||
qx{../src/task rc:$rc add foo 2>&1};
|
||||
my $output = qx{../src/task rc:$rc show 2>&1};
|
||||
like ($output, qr/^Config Variable\s+Value$/m, "$ut: Variables shown");
|
||||
unlike ($output, qr/Configuration error/ms, "$ut: No configuration error");
|
||||
unlike ($output, qr/unrecognized/ms, "$ut: No unrecognized variable");
|
||||
|
||||
## Cleanup.
|
||||
unlink qw(pending.data completed.data undo.data backlog.data bug.rc);
|
||||
unlink qw(pending.data completed.data undo.data backlog.data), $rc;
|
||||
exit 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue