Make tests more resilient
[p5sagit/Class-C3-Componentised.git] / t / 01-basic.t
CommitLineData
20169807 1use strict;
2use warnings;
3
4use FindBin;
20169807 5use Test::More;
6use Test::Exception;
7
35ef509e 8use lib "$FindBin::Bin/lib";
9
10
20169807 11plan tests => 3;
12
13use_ok('MyModule');
14
15MyModule->load_components('Foo');
16
35ef509e 17# Clear down inc so ppl dont mess us up with installing modules that we
18# expect not to exist
19@INC = ();
20
21throws_ok { MyModule->load_components('+ClassC3ComponentFooThatShouldntExist'); } qr/^Can't locate ClassC3ComponentFooThatShouldntExist.pm in \@INC/;
20169807 22
23is(MyModule->new->message, "Foo MyModule", "it worked");
24