X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=t%2F62-multi.t;fp=t%2F62-multi.t;h=b8b9d7e552e82eb1b0909359103a9626c4d2859a;hp=0000000000000000000000000000000000000000;hb=a918b0b8b7952db918dfabb8dc72bf34832d43d0;hpb=7c2181827882c125de98ccbe16402f5b277a3f44 diff --git a/t/62-multi.t b/t/62-multi.t new file mode 100644 index 0000000..b8b9d7e --- /dev/null +++ b/t/62-multi.t @@ -0,0 +1,28 @@ +use Test::More tests => 3; + +use strict; +use warnings; + +use Config::Any; +use Config::Any::YAML; + +my $file = 't/multi/conf.yml'; +my @expect = ( + { name => 'TestApp', + Model => { 'Model::Baz' => { qux => 'xyzzy' } } + }, + { name2 => 'TestApp2', + Model2 => { 'Model::Baz2' => { qux2 => 'xyzzy2' } } + }, +); + +my @results = eval { Config::Any::YAML->load( $file ); }; + +SKIP: { + skip "Can't load YAML files", 3 if $@; + is( @results, 2, '2 documents' ); + is_deeply( \@results, \@expect, 'structures ok' ); + + my $return = Config::Any->load_files( { use_ext => 1, files => [ $file ] } ); + is_deeply( $return, [ { $file => \@expect } ], 'config-any structures ok' ); +}