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 = ( |
545dcfb0 |
9 | 'Moose' => '0.81', |
ca009fe3 |
10 | 'Class::MOP' => '0.86', |
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} ) { |
23 | push @missing, "$mod must be version $prereqs{$mod} or greater"; |
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' ); |