From: Shawn M Moore Date: Wed, 29 Apr 2009 05:19:05 +0000 (-0400) Subject: Make Test::Output optional again X-Git-Tag: 0.77~27^2~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d659f7f6bcd27e8cf7958233972e45028e0de50;p=gitmo%2FMoose.git Make Test::Output optional again --- diff --git a/Changes b/Changes index 5d8da9f..a3a04b2 100644 --- a/Changes +++ b/Changes @@ -15,6 +15,10 @@ for, noteworthy changes. - Revert the class-overrides-role warning in favor of a solution outside of the Moose core (Sartak) + * Tests + - Make Test::Output optional again, since it's only used in a few files + (Sartak) + 0.75_01 Thu, April 23, 2009 * Moose::Meta::Role::Application::ToClass - Moose now warns about each class overriding methods from roles it diff --git a/lib/Moose/Cookbook/Extending/Recipe3.pod b/lib/Moose/Cookbook/Extending/Recipe3.pod index 1663b16..58d2eda 100644 --- a/lib/Moose/Cookbook/Extending/Recipe3.pod +++ b/lib/Moose/Cookbook/Extending/Recipe3.pod @@ -4,7 +4,12 @@ =begin testing-SETUP BEGIN { - use Test::Output; + eval 'use Test::Output;'; + if ($@) { + diag 'Test::Output is required for this test'; + ok(1); + exit 0; + } } =end testing-SETUP diff --git a/t/010_basics/016_load_into_main.t b/t/010_basics/016_load_into_main.t index 015d7fe..ad598cf 100644 --- a/t/010_basics/016_load_into_main.t +++ b/t/010_basics/016_load_into_main.t @@ -3,8 +3,12 @@ use strict; use warnings; -use Test::More tests => 2; -use Test::Output; +use Test::More; +BEGIN { + eval "use Test::Output;"; + plan skip_all => "Test::Output is required for this test" if $@; + plan tests => 2; +} stderr_is( sub { package main; eval 'use Moose' }, "Moose does not export its sugar to the 'main' package.\n", diff --git a/t/030_roles/019_build.t b/t/030_roles/019_build.t index 52207d5..cd973cd 100644 --- a/t/030_roles/019_build.t +++ b/t/030_roles/019_build.t @@ -1,8 +1,12 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 8; -use Test::Output; +use Test::More; +BEGIN { + eval "use Test::Output;"; + plan skip_all => "Test::Output is required for this test" if $@; + plan tests => 8; +} # this test script ensures that my idiom of: # role: sub BUILD, after BUILD diff --git a/t/050_metaclasses/012_moose_exporter.t b/t/050_metaclasses/012_moose_exporter.t index f4ab6cf..f8d82a2 100644 --- a/t/050_metaclasses/012_moose_exporter.t +++ b/t/050_metaclasses/012_moose_exporter.t @@ -3,9 +3,13 @@ use strict; use warnings; -use Test::More tests => 45; +use Test::More; use Test::Exception; -use Test::Output; +BEGIN { + eval "use Test::Output;"; + plan skip_all => "Test::Output is required for this test" if $@; + plan tests => 45; +} { diff --git a/t/300_immutable/010_constructor_is_not_moose.t b/t/300_immutable/010_constructor_is_not_moose.t index bf2bfb4..5f4e304 100644 --- a/t/300_immutable/010_constructor_is_not_moose.t +++ b/t/300_immutable/010_constructor_is_not_moose.t @@ -3,8 +3,12 @@ use strict; use warnings; -use Test::More tests => 6; -use Test::Output; +use Test::More; +BEGIN { + eval "use Test::Output;"; + plan skip_all => "Test::Output is required for this test" if $@; + plan tests => 6; +} { package NotMoose; diff --git a/t/300_immutable/011_constructor_is_wrapped.t b/t/300_immutable/011_constructor_is_wrapped.t index d5c1b3c..2d5413c 100644 --- a/t/300_immutable/011_constructor_is_wrapped.t +++ b/t/300_immutable/011_constructor_is_wrapped.t @@ -3,8 +3,12 @@ use strict; use warnings; -use Test::More tests => 1; -use Test::Output; +use Test::More; +BEGIN { + eval "use Test::Output;"; + plan skip_all => "Test::Output is required for this test" if $@; + plan tests => 1; +} { package ModdedNew; diff --git a/t/300_immutable/013_immutable_roundtrip.t b/t/300_immutable/013_immutable_roundtrip.t index 27fd869..b43a876 100644 --- a/t/300_immutable/013_immutable_roundtrip.t +++ b/t/300_immutable/013_immutable_roundtrip.t @@ -3,8 +3,12 @@ use strict; use warnings; -use Test::More tests => 1; -use Test::Output; +use Test::More; +BEGIN { + eval "use Test::Output;"; + plan skip_all => "Test::Output is required for this test" if $@; + plan tests => 1; +} { package Foo;