From 353a97280230b9a727b4ec9d81a93edd785b8dad Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 24 Aug 2014 21:10:29 -0400 Subject: [PATCH] Unit Tests - Upgraded to use the new template. --- test/bug.634.t | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/bug.634.t b/test/bug.634.t index c29e5a061..253c3c580 100755 --- a/test/bug.634.t +++ b/test/bug.634.t @@ -33,8 +33,12 @@ use Test::More tests => 2; 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=no\n"; @@ -44,14 +48,14 @@ if (open my $fh, '>', 'bug.rc') # Bug 634: confirmation=off not honored by undo # Setup: Add a task -qx{../src/task rc:bug.rc add Test 2>&1}; +qx{../src/task rc:$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}; -like ($output, qr/^Task removed.$/ms, 'Task removed.'); -unlike ($output, qr/Are you sure/ms, 'Undo honours confirmation=off.'); +my $output = qx{echo 'n' | ../src/task rc:$rc rc.confirmation=off undo 2>&1}; +like ($output, qr/^Task removed.$/ms, "$ut: Task removed."); +unlike ($output, qr/Are you sure/ms, "$ut: Undo honors confirmation=off."); # 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;