Require Moose 2.0800
[gitmo/moose-presentations.git] / moose-class / exercises / t / 00-prereq.t
CommitLineData
ddd87d75 1use strict;
2use warnings;
3
ba1c9923 4use lib 't/lib';
5
6use Test::More tests => 1;
7
ddd87d75 8my %prereqs = (
64edea8d 9 'Moose' => '2.0800',
ddd87d75 10);
11
12my @missing;
13for my $mod ( keys %prereqs ) {
14 eval "require $mod";
15
16 if ($@) {
17 push @missing, "$mod is not installed";
18 next;
19 }
20
21 if ( $mod->VERSION < $prereqs{$mod} ) {
65a201f9 22 push @missing, "$mod must be version $prereqs{$mod} or greater (you have " . $mod->VERSION . ")";
ddd87d75 23 }
24}
25
26if (@missing) {
ba1c9923 27 diag "\n***********************************************************\n";
28 diag "\n";
29 diag " Found the following prereq problems ...\n";
30 diag " $_\n" for @missing;
31 diag "\n";
32 diag " ***********************************************************\n";
ddd87d75 33}
34
ba1c9923 35ok( ! @missing, 'Checking for prereqs' );