From f59be41389d87330d67842ccc0e8a66db8ce1336 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 19 Aug 2014 00:00:21 -0400 Subject: [PATCH] Unit Tests - Updated to use new template. --- test/bug.c001.t | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/bug.c001.t b/test/bug.c001.t index 322e5553f..0e974f629 100755 --- a/test/bug.c001.t +++ b/test/bug.c001.t @@ -33,8 +33,12 @@ use Test::More tests => 1; 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"; @@ -47,13 +51,13 @@ if (open my $fh, '>', 'bug.rc') # First noticed in 1.9.4 commit 2d50d1c # Setup: Add a recurring task -qx{../src/task rc:bug.rc add First recurring task due:tomorrow rec:daily 2>&1}; +qx{../src/task rc:$rc add First recurring task due:tomorrow rec:daily 2>&1}; # Result: Ensure the second recurring task has an ID of 2 -my $output = qx{../src/task rc:bug.rc add Second recurring task due:tomorrow rec:daily 2>&1}; -like ($output, qr/Created task 2\./ms, 'Recurring task assigned correct ID.'); +my $output = qx{../src/task rc:$rc add Second recurring task due:tomorrow rec:daily 2>&1}; +like ($output, qr/Created task 2\./ms, "$ut: Recurring task assigned correct ID."); # 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;