Commit | Line | Data |
a918b0b8 |
1 | use strict; |
2 | use warnings; |
e7be073a |
3 | no warnings 'once'; |
a918b0b8 |
4 | |
5a2e0210 |
5 | use Test::More tests => 3; |
6 | |
a918b0b8 |
7 | use Config::Any; |
8 | use Config::Any::YAML; |
9 | |
e7be073a |
10 | $Config::Any::YAML::NO_YAML_XS_WARNING = 1; |
11 | |
a918b0b8 |
12 | my $file = 't/multi/conf.yml'; |
13 | my @expect = ( |
14 | { name => 'TestApp', |
15 | Model => { 'Model::Baz' => { qux => 'xyzzy' } } |
16 | }, |
17 | { name2 => 'TestApp2', |
18 | Model2 => { 'Model::Baz2' => { qux2 => 'xyzzy2' } } |
19 | }, |
20 | ); |
21 | |
22 | my @results = eval { Config::Any::YAML->load( $file ); }; |
23 | |
24 | SKIP: { |
48e4a267 |
25 | skip "Can't load multi-stream YAML files", 3 if $@; |
a918b0b8 |
26 | is( @results, 2, '2 documents' ); |
27 | is_deeply( \@results, \@expect, 'structures ok' ); |
28 | |
72628dc7 |
29 | my $return |
30 | = Config::Any->load_files( { use_ext => 1, files => [ $file ] } ); |
31 | is_deeply( |
32 | $return, |
33 | [ { $file => \@expect } ], |
34 | 'config-any structures ok' |
35 | ); |
a918b0b8 |
36 | } |