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