12 eval "use Config::General ()";
14 plan skip_all => "Config::General required for this test";
19 use_ok('MXDriverArgsConfigTest');
22 # Does it work with no configfile and not barf?
24 eval { MXDriverArgsConfigTest->new(req_attr => 'foo') };
25 ok(!$@, 'Did not die with no configfile specified')
29 # Can it load a simple YAML file with the options
31 open(my $test_conf, '>', 'test.conf')
32 or die "Cannot create test.conf: $!";
33 print $test_conf <<EOM;
35 Inherited_Ro_Attr asdf
41 MXDriverArgsConfigTest->new_with_config(configfile => 'test.conf');
43 ok(!$@, 'Did not die with good General configfile')
46 is($foo->req_attr, 'foo', 'req_attr works');
47 is($foo->direct_attr, 123, 'direct_attr works');
48 is($foo->inherited_ro_attr, 'asdf', 'inherited_ro_attr works');
51 END { unlink('test.conf') }