12 eval "use YAML::Syck ()";
16 plan skip_all => "YAML or YAML::Syck required for this test";
22 use_ok('MXSimpleConfigTest');
25 # Can it load a multiple YAML files with options
27 my $test_yaml; # generic filehandle
28 open $test_yaml, '>', 'test.yaml' or die "Cannot create test.yaml: $!";
29 print {$test_yaml} "direct_attr: 123\ninherited_ro_attr: asdf\n";
30 close $test_yaml or die "Cannot close test.yaml: $!";
32 open $test_yaml, '>', 'test2.yaml' or die "Cannot create test2.yaml: $!";
33 print {$test_yaml} "req_attr: foo\n";
34 close $test_yaml or die "Cannot close test.yaml: $!";
37 MXSimpleConfigTest->new_with_config(
38 configfile => [ 'test.yaml', 'test2.yaml' ]
41 ok(!$@, 'Did not die with two YAML config files')
44 is($foo->req_attr, 'foo', 'req_attr works');
45 is($foo->direct_attr, 123, 'direct_attr works');
46 is($foo->inherited_ro_attr, 'asdf', 'inherited_ro_attr works');