From: Dave Rolsky Date: Sun, 7 Jun 2009 20:10:06 +0000 (-0500) Subject: Added Test::Harness & Test::More to t/lib X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ba1c9923c8f29692c93e68b730e6d2b7d41aa801;p=gitmo%2Fmoose-presentations.git Added Test::Harness & Test::More to t/lib Added a hacked prove to bin (it looks in t/lib) --- diff --git a/moose-class/exercises/t/00-prereq.t b/moose-class/exercises/t/00-prereq.t index 92a507f..728aaa5 100644 --- a/moose-class/exercises/t/00-prereq.t +++ b/moose-class/exercises/t/00-prereq.t @@ -1,8 +1,11 @@ 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', ); @@ -22,18 +25,12 @@ for my $mod ( keys %prereqs ) { } 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' ); diff --git a/moose-class/exercises/t/01-classes.t b/moose-class/exercises/t/01-classes.t index 2e71127..67619ce 100644 --- a/moose-class/exercises/t/01-classes.t +++ b/moose-class/exercises/t/01-classes.t @@ -33,6 +33,7 @@ use strict; use warnings; use lib 't/lib'; + use MooseClass::Tests; use Person; diff --git a/moose-class/slides/index.html b/moose-class/slides/index.html index 10d0339..523fc25 100644 --- a/moose-class/slides/index.html +++ b/moose-class/slides/index.html @@ -60,8 +60,12 @@ img#me05 {top: 43px;left: 36px;} +
+

Part 0: Moose Concepts

+
+
-

Concepts

+

Moose background

-

Moose Classes

+

Part 1: Moose Classes

@@ -1060,15 +1064,16 @@ use Moose;
-

Classes - Exercises

+

Exercises

$ cd exercises
-$ prove -lv t/00-prereq.t
+$ perl bin/prove -lv t/00-prereq.t
 
 Missing anything? Install it. (see tarballs/)
 
-# prove -lv t/01-classes.t
-# 
+# perl bin/prove -lv t/01-classes.t
+
+Iterate til this passes all its tests