diff --git a/test/bug.991.t b/test/bug.991.t index 89d52a881..5dcbdcdd7 100755 --- a/test/bug.991.t +++ b/test/bug.991.t @@ -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;