12 eval "use YAML::Syck ()";
16 plan skip_all => "YAML or YAML::Syck required for this test";
22 use_ok('MXSimpleConfigTest');
25 # Does it work with no configfile and not barf?
27 eval { MXSimpleConfigTest->new(req_attr => 'foo') };
28 ok(!$@, 'Did not die with no configfile specified')
32 # Can it load a simple YAML file with the options
34 open(my $test_yaml, '>', 'test.yaml')
35 or die "Cannot create test.yaml: $!";
36 print $test_yaml "direct_attr: 123\ninherited_ro_attr: asdf\nreq_attr: foo\n";
40 MXSimpleConfigTest->new_with_config(configfile => 'test.yaml');
42 ok(!$@, 'Did not die with good YAML configfile')
45 is($foo->req_attr, 'foo', 'req_attr works');
46 is($foo->direct_attr, 123, 'direct_attr works');
47 is($foo->inherited_ro_attr, 'asdf', 'inherited_ro_attr works');
50 END { unlink('test.yaml') }