Skip to content

Commit 4391296

Browse files
committed
Fix test to use File::Simple->config_location
Signed-off-by: Mikko Johannes Koivunalho <[email protected]>
1 parent cc26944 commit 4391296

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

t/issues/gh-634.t

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ use File::Temp qw/tempdir/;
55
use File::Spec;
66

77
my $log_dir = tempdir( CLEANUP => 1 );
8+
sub config_location {
9+
my ($app) = @_;
10+
my %config_readers = map { $_->{name} => $_ } @{ $app->config_reader->config_readers };
11+
return $config_readers{ 'File::Simple' }->config_location;
12+
}
813

914
{
1015
package LogDirSpecified;
@@ -56,7 +61,7 @@ my $check_cb = sub {
5661

5762
is(
5863
$logger->location,
59-
$app->config_location,
64+
config_location( $app ),
6065
'Logger got correct location',
6166
);
6267

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

97102
$check_cb->(
98103
$app,
99-
File::Spec->catdir( $app->config_location, 'logs' ),
104+
File::Spec->catdir( config_location( $app ), 'logs' ),
100105
$app->environment . '.log',
101106
);
102107
};
@@ -116,4 +121,3 @@ subtest 'test Logger::File with non-existent log_dir specified' => sub {
116121
'test_log.log',
117122
);
118123
};
119-

0 commit comments

Comments
 (0)