Skip to content

Commit

Permalink
Fix test to use File::Simple->config_location
Browse files Browse the repository at this point in the history
Signed-off-by: Mikko Johannes Koivunalho <[email protected]>
  • Loading branch information
mikkoi committed May 12, 2022
1 parent cc26944 commit 4391296
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions t/issues/gh-634.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use File::Temp qw/tempdir/;
use File::Spec;

my $log_dir = tempdir( CLEANUP => 1 );
sub config_location {
my ($app) = @_;
my %config_readers = map { $_->{name} => $_ } @{ $app->config_reader->config_readers };
return $config_readers{ 'File::Simple' }->config_location;
}

{
package LogDirSpecified;
Expand Down Expand Up @@ -56,7 +61,7 @@ my $check_cb = sub {

is(
$logger->location,
$app->config_location,
config_location( $app ),
'Logger got correct location',
);

Expand Down Expand Up @@ -96,7 +101,7 @@ subtest 'test Logger::File with log_dir NOT specified' => sub {

$check_cb->(
$app,
File::Spec->catdir( $app->config_location, 'logs' ),
File::Spec->catdir( config_location( $app ), 'logs' ),
$app->environment . '.log',
);
};
Expand All @@ -116,4 +121,3 @@ subtest 'test Logger::File with non-existent log_dir specified' => sub {
'test_log.log',
);
};

0 comments on commit 4391296

Please sign in to comment.