X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=t%2F51-ini.t;h=5cee996ca5642bf6c3ac5b08b4d32f4093c68045;hp=6848004d51bca8f03aa0b8a3c93d907b85c9b4d1;hb=HEAD;hpb=5770ffc01feb6998b8a7e23d66b52d33e4a62b35 diff --git a/t/51-ini.t b/t/51-ini.t index 6848004..5cee996 100644 --- a/t/51-ini.t +++ b/t/51-ini.t @@ -2,13 +2,14 @@ use strict; use warnings; use Test::More; +use Config::Any; use Config::Any::INI; -if ( !Config::Any::INI->is_supported ) { +if ( !Config::Any::INI->is_supported && !$ENV{RELEASE_TESTING} ) { plan skip_all => 'INI format not supported'; } else { - plan tests => 13; + plan tests => 15; } { @@ -49,9 +50,18 @@ else { # test invalid config { - my $file = 't/invalid/conf.ini'; + my $file = 't/invalid/conf.ini'; my $config = eval { Config::Any::INI->load( $file ) }; - ok( !$config, 'config load failed' ); - ok( $@, "error thrown ($@)" ); + is $config, undef, 'config load failed'; + isnt $@, '', 'error thrown'; +} + +# parse error generated on invalid config +{ + my $file = 't/invalid/conf.ini'; + my $config = eval { Config::Any->load_files( { files => [$file], use_ext => 1} ) }; + + is $config, undef, 'config load failed'; + isnt $@, '', 'error thrown'; }