Commit | Line | Data |
20169807 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use FindBin; |
20169807 |
5 | use Test::More; |
6 | use Test::Exception; |
7 | |
35ef509e |
8 | use lib "$FindBin::Bin/lib"; |
9 | |
10 | |
20169807 |
11 | plan tests => 3; |
12 | |
13 | use_ok('MyModule'); |
14 | |
15 | MyModule->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 | |
21 | throws_ok { MyModule->load_components('+ClassC3ComponentFooThatShouldntExist'); } qr/^Can't locate ClassC3ComponentFooThatShouldntExist.pm in \@INC/; |
20169807 |
22 | |
23 | is(MyModule->new->message, "Foo MyModule", "it worked"); |
24 | |