From 7f08ec5a63530cb3535ca18b5fe7dce1f6aa20f0 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 1 Jun 2014 10:20:43 -0400 Subject: [PATCH] Unit Tests - Removed useless setup/teardown tests, improving the signal to noise ratio. --- test/custom.columns.t | 9 +-------- test/custom.priority_long.t | 9 +-------- test/custom.recur_ind.t | 9 +-------- test/custom.t | 9 +-------- test/custom.tag_ind.t | 9 +-------- 5 files changed, 5 insertions(+), 40 deletions(-) diff --git a/test/custom.columns.t b/test/custom.columns.t index 10de67676..de9d50a4f 100755 --- a/test/custom.columns.t +++ b/test/custom.columns.t @@ -27,7 +27,7 @@ use strict; use warnings; -use Test::More tests => 3; +use Test::More tests => 1; # Ensure environment has no influence. delete $ENV{'TASKDATA'}; @@ -42,7 +42,6 @@ if (open my $fh, '>', 'custom.rc') "report.foo.sort=id+\n", "report.foo.filter=project:A\n"; close $fh; - ok (-r 'custom.rc', 'Created custom.rc'); } # Generate the usage screen, and locate the custom report on it. @@ -51,11 +50,5 @@ like ($output, qr/Unrecognized column name 'foo'\.\n/, 'custom report spotted in # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data custom.rc); -ok (! -r 'pending.data' && - ! -r 'completed.data' && - ! -r 'undo.data' && - ! -r 'backlog.data' && - ! -r 'custom.rc', 'Cleanup'); - exit 0; diff --git a/test/custom.priority_long.t b/test/custom.priority_long.t index a79ee9c4e..1c5657a82 100755 --- a/test/custom.priority_long.t +++ b/test/custom.priority_long.t @@ -27,7 +27,7 @@ use strict; use warnings; -use Test::More tests => 6; +use Test::More tests => 4; # Ensure environment has no influence. delete $ENV{'TASKDATA'}; @@ -42,7 +42,6 @@ if (open my $fh, '>', 'pri.rc') "report.foo.labels=ID,Pri\n", "report.foo.sort=id+\n"; close $fh; - ok (-r 'pri.rc', 'Created pri.rc'); } # Generate the usage screen, and locate the custom report on it. @@ -58,11 +57,5 @@ like ($output, qr/3\s+Low/, 'priority.long Low'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data pri.rc); -ok (! -r 'pending.data' && - ! -r 'completed.data' && - ! -r 'undo.data' && - ! -r 'backlog.data' && - ! -r 'pri.rc', 'Cleanup'); - exit 0; diff --git a/test/custom.recur_ind.t b/test/custom.recur_ind.t index 12e1964fe..d22373db4 100755 --- a/test/custom.recur_ind.t +++ b/test/custom.recur_ind.t @@ -27,7 +27,7 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 5; # Ensure environment has no influence. delete $ENV{'TASKDATA'}; @@ -42,7 +42,6 @@ if (open my $fh, '>', 'custom.rc') "report.foo.labels=ID,R\n", "report.foo.sort=id+\n"; close $fh; - ok (-r 'custom.rc', 'Created custom.rc'); } # Add a recurring and non-recurring task, look for the indicator. @@ -59,11 +58,5 @@ unlike ($output, qr/2\s+RE/, 'No custom recurrence indicator t2'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data custom.rc); -ok (! -r 'pending.data' && - ! -r 'completed.data' && - ! -r 'undo.data' && - ! -r 'backlog.data' && - ! -r 'custom.rc', 'Cleanup'); - exit 0; diff --git a/test/custom.t b/test/custom.t index 63d5145f7..031fa14c5 100755 --- a/test/custom.t +++ b/test/custom.t @@ -27,7 +27,7 @@ use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 3; # Ensure environment has no influence. delete $ENV{'TASKDATA'}; @@ -42,7 +42,6 @@ if (open my $fh, '>', 'custom.rc') "report.foo.sort=id+\n", "report.foo.filter=project:A\n"; close $fh; - ok (-r 'custom.rc', 'Created custom.rc'); } # Generate the help screen, and locate the custom report on it. @@ -57,11 +56,5 @@ unlike ($output, qr/two/, 'custom filter excluded'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data custom.rc); -ok (! -r 'pending.data' && - ! -r 'completed.data' && - ! -r 'undo.data' && - ! -r 'backlog.data' && - ! -r 'custom.rc', 'Cleanup'); - exit 0; diff --git a/test/custom.tag_ind.t b/test/custom.tag_ind.t index c4650cdad..730487d87 100755 --- a/test/custom.tag_ind.t +++ b/test/custom.tag_ind.t @@ -27,7 +27,7 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 5; # Ensure environment has no influence. delete $ENV{'TASKDATA'}; @@ -42,7 +42,6 @@ if (open my $fh, '>', 'custom.rc') "report.foo.labels=ID,T\n", "report.foo.sort=id+\n"; close $fh; - ok (-r 'custom.rc', 'Created custom.rc'); } # Generate the usage screen, and locate the custom report on it. @@ -59,11 +58,5 @@ unlike ($output, qr/2\s+TAG/, 'No custom tag indicator t2'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data custom.rc); -ok (! -r 'pending.data' && - ! -r 'completed.data' && - ! -r 'undo.data' && - ! -r 'backlog.data' && - ! -r 'custom.rc', 'Cleanup'); - exit 0;