Skip to content

Commit

Permalink
Test error message when directory doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Sep 13, 2024
1 parent e82e4b1 commit 493b11e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions t/carp.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

use strict;
use warnings;
use Test::Most tests => 5;
use Test::Most tests => 6;
use Test::Needs 'Test::Carp';

BEGIN {
use_ok('Genealogy::ObituaryDailyTimes');
}

SKIP: {
skip 'Database not installed', 4 if(!-r 'lib/Genealogy/ObituaryDailyTimes/data/obituaries.sql');
skip('Database not installed', 5) if(!-r 'lib/Genealogy/ObituaryDailyTimes/data/obituaries.sql');

Test::Carp->import();

Expand All @@ -19,5 +19,6 @@ SKIP: {
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/);
does_carp_that_matches(sub { my @empty = $search->search({ last => undef }); }, qr/^Value for 'last' is mandatory/);
does_carp_that_matches(sub { my $o = Genealogy::ObituaryDailyTimes->new({ directory => '/not_there' }); }, qr/ is not a directory$/);
done_testing();
}

0 comments on commit 493b11e

Please sign in to comment.