exercises for part 1
[gitmo/moose-presentations.git] / moose-class / exercises / t / 00-prereq.t
CommitLineData
ddd87d75 1use strict;
2use warnings;
3
4my %prereqs = (
5 'Test::More' => '0',
6 'Moose' => '0.80',
7 'Class::MOP' => '0.85',
8);
9
10my @missing;
11for my $mod ( keys %prereqs ) {
12 eval "require $mod";
13
14 if ($@) {
15 push @missing, "$mod is not installed";
16 next;
17 }
18
19 if ( $mod->VERSION < $prereqs{$mod} ) {
20 push @missing, "$mod must be version $prereqs{$mod} or greater";
21 }
22}
23
24if (@missing) {
25 warn "\n# ***********************************************************\n";
26 warn "#\n";
27 warn "# Found the following prereq problems ...\n";
28 warn "# $_\n" for @missing;
29 warn "#\n";
30 warn "# ***********************************************************\n";
31
32 exit 255;
33}
34
35Test::More->import;
36
37plan( tests => 1 );
38ok( 'Looks like you have all the prereqs' );
39