Added Test::Harness & Test::More to t/lib
[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'      => '0.80',
10     'Class::MOP' => '0.85',
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) {
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";
34 }
35
36 ok( ! @missing, 'Checking for prereqs' );