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