Require latest Moose
[gitmo/moose-presentations.git] / moose-class / exercises / t / 00-prereq.t
index 92a507f..91feea6 100644 (file)
@@ -1,10 +1,13 @@
 use strict;
 use warnings;
 
+use lib 't/lib';
+
+use Test::More tests => 1;
+
 my %prereqs = (
-    'Test::More' => '0',
-    'Moose'      => '0.80',
-    'Class::MOP' => '0.85',
+    'Moose'      => '0.92',
+    'Class::MOP' => '0.94',
 );
 
 my @missing;
@@ -17,23 +20,17 @@ for my $mod ( keys %prereqs ) {
     }
 
     if ( $mod->VERSION < $prereqs{$mod} ) {
-        push @missing, "$mod must be version $prereqs{$mod} or greater";
+        push @missing, "$mod must be version $prereqs{$mod} or greater (you have " . $mod->VERSION . ")";
     }
 }
 
 if (@missing) {
-    warn "\n# ***********************************************************\n";
-    warn "#\n";
-    warn "# Found the following prereq problems ...\n";
-    warn "#   $_\n" for @missing;
-    warn "#\n";
-    warn "# ***********************************************************\n";
-
-    exit 255;
+    diag "\n***********************************************************\n";
+    diag "\n";
+    diag " Found the following prereq problems ...\n";
+    diag "   $_\n" for @missing;
+    diag "\n";
+    diag " ***********************************************************\n";
 }
 
-Test::More->import;
-
-plan( tests => 1 );
-ok( 'Looks like you have all the prereqs' );
-
+ok( ! @missing, 'Checking for prereqs' );