6 use Test::More tests => 6;
12 use_ok('MXSimpleConfigTest');
15 # Does it work with no configfile and not barf?
17 eval { MXSimpleConfigTest->new(req_attr => 'foo') };
18 ok(!$@, 'Did not die with no configfile specified')
22 # Can it load a simple YAML file with the options
24 open(my $test_yaml, '>', 'test.yaml')
25 or die "Cannot create test.yaml: $!";
26 print $test_yaml "direct_attr: 123\ninherited_ro_attr: asdf\nreq_attr: foo\n";
30 MXSimpleConfigTest->new_with_config(configfile => 'test.yaml');
32 ok(!$@, 'Did not die with good YAML configfile')
35 is($foo->req_attr, 'foo', 'req_attr works');
36 is($foo->direct_attr, 123, 'direct_attr works');
37 is($foo->inherited_ro_attr, 'asdf', 'inherited_ro_attr works');
40 END { unlink('test.yaml') }