Make tests more resilient
[p5sagit/Class-C3-Componentised.git] / t / 01-basic.t
index 0a09da6..ca06d35 100644 (file)
@@ -2,18 +2,23 @@ use strict;
 use warnings;
 
 use FindBin;
-use lib "$FindBin::Bin/lib";
-
 use Test::More;
 use Test::Exception;
 
+use lib "$FindBin::Bin/lib";
+
+
 plan tests => 3;
 
 use_ok('MyModule');
 
 MyModule->load_components('Foo');
 
-throws_ok { MyModule->load_components('+Foo'); } qr/^Can't locate Foo.pm in \@INC/;
+# Clear down inc so ppl dont mess us up with installing modules that we
+# expect not to exist
+@INC = ();
+
+throws_ok { MyModule->load_components('+ClassC3ComponentFooThatShouldntExist'); } qr/^Can't locate ClassC3ComponentFooThatShouldntExist.pm in \@INC/;
 
 is(MyModule->new->message, "Foo MyModule", "it worked");