Skip to content

Commit

Permalink
t/carp.t could sometimes fail
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Feb 8, 2024
1 parent bb8b9d5 commit 1501037
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Revision history for Genealogy::ObituaryDailyTimes

0.12
t/carp.t could sometimes fail

0.11 Thu Feb 8 09:03:49 EST 2024
Added first, last, age as an index
Renamed database to data
Expand Down
1 change: 1 addition & 0 deletions lib/Genealogy/ObituaryDailyTimes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ sub new {
return bless { %{$class}, %args }, ref($class);
}

# if(!defined((my $directory = ($args{'directory'} || $Database::Abstraction::defaults{'directory'})))) {
if(!(my $directory = $args{'directory'})) {
# If the directory argument isn't given, see if we can find the data
$directory ||= Module::Info->new_from_loaded(__PACKAGE__)->file();
Expand Down
2 changes: 1 addition & 1 deletion t/carp.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SKIP: {

Test::Carp->import();

my $search = new_ok('Genealogy::ObituaryDailyTimes');
my $search = new_ok('Genealogy::ObituaryDailyTimes' => [ directory => 'lib/Genealogy/ObituaryDailyTimes/data' ]);

does_carp_that_matches(sub { my @empty = $search->search(); }, qr/^Value for 'last' is mandatory/);
does_carp_that_matches(sub { my @empty = $search->search(last => undef); }, qr/^Value for 'last' is mandatory/);
Expand Down
2 changes: 2 additions & 0 deletions t/obituaries.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ BEGIN {
SKIP: {
skip 'Database not installed', 12 if(!-r 'lib/Genealogy/ObituaryDailyTimes/data/obituaries.sql');

Database::Abstraction::init('directory' => 'lib/Genealgy/ObituaryDailyTimes/data');

my $search;
if($ENV{'TEST_VERBOSE'}) {
$search = new_ok('Genealogy::ObituaryDailyTimes' => [ logger => MyLogger->new() ]);
Expand Down

0 comments on commit 1501037

Please sign in to comment.