From: Joel Bernstein Date: Fri, 10 Apr 2009 21:04:00 +0000 (+0100) Subject: Fix test failures when user does not have C::Method::Modifiers(::Fast) installed X-Git-Tag: 0.21~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49a56bbafc81e4d50e4a95a65f987a448dfe5ecc;p=gitmo%2FMouse.git Fix test failures when user does not have C::Method::Modifiers(::Fast) installed --- diff --git a/t/000-recipes/002_schwartz_tutorial.t b/t/000-recipes/002_schwartz_tutorial.t index cad54b4..c23715e 100755 --- a/t/000-recipes/002_schwartz_tutorial.t +++ b/t/000-recipes/002_schwartz_tutorial.t @@ -10,6 +10,17 @@ use strict; use warnings; +use Test::More; + +BEGIN { + plan skip_all => + "This test requires Class::Method::Modifiers or Class::Method::Modifiers::Fast" + unless eval { + require Class::Method::Modifiers::Fast; + } or eval { + require Class::Method::Modifiers; + }; +} # functions to capture the output of the tutorial our $DUMMY_STDOUT = ""; @@ -105,7 +116,7 @@ no Mouse; ###################################################################### # Now the tests package main; -use Test::More tests => 5; +plan tests => 5; #use Horse; my $talking = Horse->new(name => 'Mr. Ed'); diff --git a/t/030_roles/003_apply_role.t b/t/030_roles/003_apply_role.t index 1ab9f3f..3aaee4f 100755 --- a/t/030_roles/003_apply_role.t +++ b/t/030_roles/003_apply_role.t @@ -2,8 +2,18 @@ use strict; use warnings; +use Test::More; +BEGIN { + plan skip_all => + "This test requires Class::Method::Modifiers or Class::Method::Modifiers::Fast" + unless eval { + require Class::Method::Modifiers::Fast; + } or eval { + require Class::Method::Modifiers; + }; +} -use Test::More tests => 86; +plan tests => 86; use Test::Exception; { diff --git a/t/030_roles/019_build.t b/t/030_roles/019_build.t index f76ea5a..8d3a4a4 100644 --- a/t/030_roles/019_build.t +++ b/t/030_roles/019_build.t @@ -1,7 +1,19 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 6; +use Test::More; +BEGIN { + plan skip_all => + "This test requires Class::Method::Modifiers or Class::Method::Modifiers::Fast" + unless eval { + require Class::Method::Modifiers::Fast; + } or eval { + require Class::Method::Modifiers; + }; +} + +plan tests => 6; + # this test script ensures that my idiom of: # role: sub BUILD, after BUILD