From 8f3889d347833afa50cda1e5931121960e0db640 Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Tue, 10 Dec 2024 15:28:40 -0500 Subject: [PATCH] More Test::DescribeMe --- t/fixme.t | 33 ++++++++++++++++++--------------- t/strict.t | 16 +++++----------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/t/fixme.t b/t/fixme.t index 09a459d..01391d8 100644 --- a/t/fixme.t +++ b/t/fixme.t @@ -4,29 +4,32 @@ use strict; use warnings; + +use Test::DescribeMe qw(author); use Test::Most; my @messages; -if($ENV{AUTHOR_TESTING}) { - is($INC{'Devel/FIXME.pm'}, undef, "Devel::FIXME isn't loaded yet"); +is($INC{'Devel/FIXME.pm'}, undef, "Devel::FIXME isn't loaded yet"); - eval 'use Devel::FIXME'; - if($@) { - diag('Devel::FIXME required for looking for FIXMEs'); - done_testing(1); - } else { - # $Devel::FIXME::REPAIR_INC = 1; +eval 'use Devel::FIXME'; +if($@) { + # AUTHOR_TESTING=1 perl -MTest::Without::Module=Devel::FIXME -w -Iblib/lib t/fixme.t + diag('Devel::FIXME needed to test for FIXMEs'); + done_testing(1); +} else { + $ENV{'GATEWAY_INTERFACE'} = 'CGI/1.1'; + $ENV{'REQUEST_METHOD'} = 'GET'; + $ENV{'QUERY_STRING'} = 'fred=wilma'; - use_ok('Genealogy::ObituaryDailyTimes'); + # $Devel::FIXME::REPAIR_INC = 1; - # ok($messages[0] !~ /lib\/Genealogy\/ObituaryDailyTimes.pm/); - ok(scalar(@messages) == 0); + use_ok('Genealogy::ObituaryDailyTimes'); - done_testing(3); - } -} else { - plan(skip_all => 'Author tests not required for installation'); + # ok($messages[0] !~ /lib\/Genealogy\/ObituaryDailyTimes.pm/); + cmp_ok(scalar(@messages), '==', 0, 'No FIXMEs found'); + + done_testing(3); } sub Devel::FIXME::rules { diff --git a/t/strict.t b/t/strict.t index d7d6159..458516a 100644 --- a/t/strict.t +++ b/t/strict.t @@ -3,16 +3,10 @@ use strict; use warnings; +use Test::DescribeMe qw(author); use Test::Most; +use Test::Needs 'Test::Strict'; -if($ENV{AUTHOR_TESTING}) { - eval 'use Test::Strict'; - if($@) { - plan(skip_all => 'Test::Strict required for testing use strict'); - } else { - all_perl_files_ok(); - warnings_ok('lib/Genealogy/ObituaryDailyTimes.pm'); - } -} else { - plan(skip_all => 'Author tests not required for installation'); -} +Test::Strict->import(); +all_perl_files_ok(); +warnings_ok('lib/CGI/Info.pm');