Require Moose 2.0800
[gitmo/moose-presentations.git] / moose-class / exercises / t / 00-prereq.t
1 use strict;
2 use warnings;
3
4 use lib 't/lib';
5
6 use Test::More tests => 1;
7
8 my %prereqs = (
9     'Moose'      => '2.0800',
10 );
11
12 my @missing;
13 for 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} ) {
22         push @missing, "$mod must be version $prereqs{$mod} or greater (you have " . $mod->VERSION . ")";
23     }
24 }
25
26 if (@missing) {
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";
33 }
34
35 ok( ! @missing, 'Checking for prereqs' );