X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=t%2F10-branches.t;h=b2118764bd0c2a77750c769d57723a456fde02bd;hp=adda42d300da9ae3aa4950ca828618e339cf8933;hb=1d172fc510f2ed15a00d475073f6df964b398484;hpb=92a04e78451078b33f75e7c44d247b024c27b4f7 diff --git a/t/10-branches.t b/t/10-branches.t index adda42d..b211876 100644 --- a/t/10-branches.t +++ b/t/10-branches.t @@ -1,27 +1,45 @@ -use Test::More tests => 9; -use Config::Any; +use strict; +use warnings; -ok( !Config::Any->load_files(), "load_files expects args" ); -ok( !Config::Any->load_stems(), "load_stems expects args" ); +use Test::More tests => 10; + +use_ok( 'Config::Any' ); { my @warnings; local $SIG{ __WARN__ } = sub { push @warnings, @_ }; + + Config::Any->load_files(); + like( + shift @warnings, + qr/^No files specified!/, + "load_files expects args" + ); + Config::Any->load_files( {} ); like( shift @warnings, - qr/^no files specified/, + qr/^No files specified!/, "load_files expects files" ); + + Config::Any->load_stems(); + like( + shift @warnings, + qr/^No stems specified!/, + "load_stems expects args" + ); + Config::Any->load_stems( {} ); like( shift @warnings, - qr/^no stems specified/, + qr/^No stems specified!/, "load_stems expects stems" ); } -my @files = glob( "t/conf/conf.*" ); +# grep out files we don't understand for these tests +my @files = grep { !m{\.(foo|unsupported)$} } glob( "t/conf/conf.*" ); my $filter = sub { return }; ok( Config::Any->load_files( { files => \@files, use_ext => 0 } ), "use_ext 0 works" );