prep release
[p5sagit/Config-Any.git] / t / 62-multi.t
CommitLineData
a918b0b8 1use strict;
2use warnings;
e7be073a 3no warnings 'once';
a918b0b8 4
5a2e0210 5use Test::More tests => 3;
6
a918b0b8 7use Config::Any;
8use Config::Any::YAML;
9
10my $file = 't/multi/conf.yml';
11my @expect = (
12 { name => 'TestApp',
13 Model => { 'Model::Baz' => { qux => 'xyzzy' } }
14 },
15 { name2 => 'TestApp2',
16 Model2 => { 'Model::Baz2' => { qux2 => 'xyzzy2' } }
17 },
18);
19
20my @results = eval { Config::Any::YAML->load( $file ); };
21
22SKIP: {
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}