From: Dave Rolsky <autarch@urth.org>
Date: Fri, 10 Sep 2010 16:38:04 +0000 (-0500)
Subject: Use Test::Requires in recipe tests
X-Git-Tag: 1.13~6
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0adca353bd88302289a574fc9a22c91f1968a15f;p=gitmo%2FMoose.git

Use Test::Requires in recipe tests
---

diff --git a/lib/Moose/Cookbook/Basics/Recipe11.pod b/lib/Moose/Cookbook/Basics/Recipe11.pod
index 82b7cf3..a339014 100644
--- a/lib/Moose/Cookbook/Basics/Recipe11.pod
+++ b/lib/Moose/Cookbook/Basics/Recipe11.pod
@@ -3,14 +3,10 @@
 
 =begin testing-SETUP
 
-BEGIN {
-    eval 'use DateTime; use DateTime::Calendar::Mayan;';
-    if ($@) {
-        diag 'DateTime & DateTime::Calendar::Mayan required for this test';
-        ok(1);
-        exit 0;
-    }
-}
+use Test::Requires {
+    'DateTime'                  => '0',
+    'DateTime::Calendar::Mayan' => '0',
+};
 
 =end testing-SETUP
 
diff --git a/lib/Moose/Cookbook/Basics/Recipe4.pod b/lib/Moose/Cookbook/Basics/Recipe4.pod
index f5fd597..325b43b 100644
--- a/lib/Moose/Cookbook/Basics/Recipe4.pod
+++ b/lib/Moose/Cookbook/Basics/Recipe4.pod
@@ -3,14 +3,10 @@
 
 =begin testing-SETUP
 
-BEGIN {
-    eval 'use Regexp::Common; use Locale::US;';
-    if ($@) {
-        diag 'Regexp::Common & Locale::US required for this test';
-        ok(1);
-        exit 0;
-    }
-}
+use Test::Requires {
+    'Locale::US'     => '0',
+    'Regexp::Common' => '0',
+};
 
 =end testing-SETUP
 
diff --git a/lib/Moose/Cookbook/Basics/Recipe5.pod b/lib/Moose/Cookbook/Basics/Recipe5.pod
index 2cfa2a6..d901d57 100644
--- a/lib/Moose/Cookbook/Basics/Recipe5.pod
+++ b/lib/Moose/Cookbook/Basics/Recipe5.pod
@@ -3,14 +3,11 @@
 
 =begin testing-SETUP
 
-BEGIN {
-    eval 'use HTTP::Headers; use Params::Coerce; use URI;';
-    if ($@) {
-        diag 'HTTP::Headers, Params::Coerce & URI required for this test';
-        ok(1);
-        exit 0;
-    }
-}
+use Test::Requires {
+    'HTTP::Headers'  => '0',
+    'Params::Coerce' => '0',
+    'URI'            => '0',
+};
 
 =end testing-SETUP
 
diff --git a/lib/Moose/Cookbook/Extending/Recipe2.pod b/lib/Moose/Cookbook/Extending/Recipe2.pod
index 8fff44c..b37d3a6 100644
--- a/lib/Moose/Cookbook/Extending/Recipe2.pod
+++ b/lib/Moose/Cookbook/Extending/Recipe2.pod
@@ -3,14 +3,9 @@
 
 =begin testing-SETUP
 
-BEGIN {
-    eval 'use Test::Output;';
-    if ($@) {
-        diag 'Test::Output is required for this test';
-        ok(1);
-        exit 0;
-    }
-}
+use Test::Requires {
+    'Test::Output' => '0',
+};
 
 =end testing-SETUP
 
diff --git a/lib/Moose/Cookbook/Extending/Recipe3.pod b/lib/Moose/Cookbook/Extending/Recipe3.pod
index 012c185..1028a58 100644
--- a/lib/Moose/Cookbook/Extending/Recipe3.pod
+++ b/lib/Moose/Cookbook/Extending/Recipe3.pod
@@ -3,14 +3,9 @@
 
 =begin testing-SETUP
 
-BEGIN {
-    eval 'use Test::Output;';
-    if ($@) {
-        diag 'Test::Output is required for this test';
-        ok(1);
-        exit 0;
-    }
-}
+use Test::Requires {
+    'Test::Output' => '0',
+};
 
 =end testing-SETUP