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=f82303bbc69daf22d70a073dba5f53b9c89f73cf;hp=90dc25b8659f27fb8f6317025e6ff3af52f676db;hb=803bbb1153db2f996a881286fdfe81eaa3c75b24;hpb=4efab5582d1ec3acd99a2ffb898bed58d5f2420b diff --git a/t/10-branches.t b/t/10-branches.t index 90dc25b..f82303b 100644 --- a/t/10-branches.t +++ b/t/10-branches.t @@ -1,13 +1,16 @@ -use Test::More tests => 9; -use Config::Any; +use strict; +use warnings; -ok( !Config::Any->load_stems(), "load_stems expects args" ); +# use Test::Without::Module qw(YAML YAML::Syck Config::General XML::Simple JSON JSON::Syck Config::Tiny ); +use Test::More tests => 10; + +use_ok( 'Config::Any' ); { my @warnings; local $SIG{ __WARN__ } = sub { push @warnings, @_ }; - Config::Any->load_files( ); + Config::Any->load_files(); like( shift @warnings, qr/^No files specified!/, @@ -21,18 +24,26 @@ ok( !Config::Any->load_stems(), "load_stems expects args" ); "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.*" ); -my $filter = sub { return }; +my @files = glob( "t/supported/conf.*" ); ok( Config::Any->load_files( { files => \@files, use_ext => 0 } ), "use_ext 0 works" ); + +my $filter = sub { return }; ok( Config::Any->load_files( { files => \@files, use_ext => 1 } ), "use_ext 1 works" ); @@ -51,6 +62,6 @@ eval { }; ok( $@, "filter breaks" ); -my @stems = qw(t/conf/conf); +my @stems = qw(t/supported/conf); ok( Config::Any->load_stems( { stems => \@stems, use_ext => 1 } ), "load_stems with stems works" );