ensure require() happens against plugin specified in force_plugins
[p5sagit/Config-Any.git] / t / 10-branches.t
index adda42d..f82303b 100644 (file)
@@ -1,30 +1,49 @@
-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 $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" );
 
@@ -43,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" );