Skip to content

Commit c30f818

Browse files
committed
Change DANCER_CONFIG_READERS separator
1 parent 4a62c1b commit c30f818

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

lib/Dancer2/ConfigReader.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ sub _build_config_readers {
9898
my ($self) = @_;
9999

100100
my @config_reader_names = $ENV{'DANCER_CONFIG_READERS'}
101-
? (split qr{ \s+ }msx, $ENV{'DANCER_CONFIG_READERS'})
101+
? (split qr{,}msx, $ENV{'DANCER_CONFIG_READERS'})
102102
: ( q{Dancer2::ConfigReader::File::Simple} );
103103

104104
warn "ConfigReaders to use: @config_reader_names\n" if $ENV{DANCER_CONFIG_VERBOSE};
@@ -129,9 +129,9 @@ class or classes to use to create the config.
129129
Use C<DANCER_CONFIG_READERS> environment variable to define
130130
which class or classes you want.
131131
132-
DANCER_CONFIG_READERS='Dancer2::ConfigReader::File::Simple Dancer2::ConfigReader::CustomConfig'
132+
DANCER_CONFIG_READERS='Dancer2::ConfigReader::File::Simple,Dancer2::ConfigReader::CustomConfig'
133133
134-
If you want several, separate them with whitespace.
134+
If you want several, separate them with a comma (",").
135135
Configs are added in left-to-write order where the previous
136136
config items get overwritten by subsequent ones.
137137

t/config_many.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BEGIN {
99
local $ENV{DANCER_ENVIRONMENT};
1010
local $ENV{PLACK_ENV};
1111
$ENV{DANCER_CONFIG_READERS}
12-
= 'Dancer2::ConfigReader::File::Simple Dancer2::ConfigReader::TestDummy';
12+
= 'Dancer2::ConfigReader::File::Simple,Dancer2::ConfigReader::TestDummy';
1313
}
1414
use lib '.';
1515
use lib './t/lib';

t/config_many_failure.t

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
use strict;
2+
use warnings;
3+
4+
use Test::More;
5+
use File::Spec;
6+
use English;
7+
8+
BEGIN {
9+
# undefine ENV vars used as defaults for app environment in these tests
10+
local $ENV{DANCER_ENVIRONMENT};
11+
local $ENV{PLACK_ENV};
12+
$ENV{DANCER_CONFIG_READERS}
13+
= 'Dancer2::ConfigReader::File::Simple Dancer2::ConfigReader::TestDummy';
14+
}
15+
16+
use lib q{.};
17+
use lib './t/lib';
18+
19+
local $EVAL_ERROR = undef;
20+
my $eval_r = eval 'use t::app::t1::lib::App1;';
21+
my $eval_e = $EVAL_ERROR;
22+
is $eval_r, undef, 'Eval failed correctly';
23+
like $eval_e, qr{`Dancer2::ConfigReader::File::Simple Dancer2::ConfigReader::TestDummy' is not a module name}, 'Correct dying and error';
24+
25+
done_testing;

0 commit comments

Comments
 (0)