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