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