X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F11default.t;h=0011e3554c76441ac39d3462f01067a6a112874a;hb=refs%2Ftags%2F0.08;hp=aaacca28c4d088f8e3ab725f166e794b9c367165;hpb=a96520dd1f1563ad6c55047dea3f80e0bd125c41;p=gitmo%2FMooseX-SimpleConfig.git diff --git a/t/11default.t b/t/11default.t index aaacca2..0011e35 100644 --- a/t/11default.t +++ b/t/11default.t @@ -5,9 +5,11 @@ use warnings; use lib 't/lib'; use lib '../t/lib'; - +use Test::More; +our @classes; BEGIN { - use Test::More; + + @classes = qw/ MXDefaultConfigTest MXDefaultMultipleConfigsTest /; eval "use YAML::Syck ()"; if($@) { @@ -16,10 +18,8 @@ BEGIN { plan skip_all => "YAML or YAML::Syck required for this test"; } } - - plan tests => 5; - use_ok('MXDefaultConfigTest'); + use_ok($_) for @classes; } # Can it load a simple YAML file with the options @@ -30,8 +30,11 @@ BEGIN { print $test_yaml "direct_attr: 123\ninherited_ro_attr: asdf\nreq_attr: foo\n"; close($test_yaml); +} + +foreach my $class (@classes) { my $foo = eval { - MXDefaultConfigTest->new_with_config(); + $class->new_with_config(); }; ok(!$@, 'Did not die with good YAML configfile') or diag $@; @@ -41,4 +44,6 @@ BEGIN { is($foo->inherited_ro_attr, 'asdf', 'inherited_ro_attr works'); } +done_testing; + END { unlink('test.yaml') }