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=d00377bf4687d95586f01ef307f7d74458f8995a;hp=adda42d300da9ae3aa4950ca828618e339cf8933;hb=df0b9676f6f1ce3441a2d2f83cdcb8cd4a952966;hpb=92a04e78451078b33f75e7c44d247b024c27b4f7 diff --git a/t/10-branches.t b/t/10-branches.t index adda42d..d00377b 100644 --- a/t/10-branches.t +++ b/t/10-branches.t @@ -1,30 +1,54 @@ -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::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(); + 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.*" ); +my @files = glob( "t/supported/conf.*" ); +{ + require Config::Any::General; + local $SIG{ __WARN__ } = sub { } + if Config::Any::General->is_supported; + 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 => 0 } ), - "use_ext 0 works" ); ok( Config::Any->load_files( { files => \@files, use_ext => 1 } ), "use_ext 1 works" ); @@ -43,6 +67,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" );