Skip to content

Commit

Permalink
More Test::DescribeMe
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Dec 10, 2024
1 parent 9dfb7ed commit 8f3889d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
33 changes: 18 additions & 15 deletions t/fixme.t
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 5 additions & 11 deletions t/strict.t
Original file line number Diff line number Diff line change
Expand Up @@ -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');

0 comments on commit 8f3889d

Please sign in to comment.