add XML::NamespaceSupport to XML format deps, silence YAML warnings in tests
[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
e7be073a 10$Config::Any::YAML::NO_YAML_XS_WARNING = 1;
11
a918b0b8 12my $file = 't/multi/conf.yml';
13my @expect = (
14 { name => 'TestApp',
15 Model => { 'Model::Baz' => { qux => 'xyzzy' } }
16 },
17 { name2 => 'TestApp2',
18 Model2 => { 'Model::Baz2' => { qux2 => 'xyzzy2' } }
19 },
20);
21
22my @results = eval { Config::Any::YAML->load( $file ); };
23
24SKIP: {
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}