From: Shawn M Moore Date: Tue, 21 Apr 2009 06:14:40 +0000 (-0400) Subject: Unconditionally depend on Test::Output; dropping Test::Warn X-Git-Tag: 0.75_01~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b23f9f8b58df3d8a9a70c00aeaed77de724355c;p=gitmo%2FMoose.git Unconditionally depend on Test::Output; dropping Test::Warn --- diff --git a/Changes b/Changes index 14d50a5..e9ea751 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,11 @@ Also see Moose::Manual::Delta for more details of, and workarounds for, noteworthy changes. +0.76 + * Tests + - Warnings tests have standardized on Test::Output which is now an + unconditionally dependency (Sartak) + 0.75 Mon, April 20, 2009 * Moose * Moose::Meta::Class diff --git a/Makefile.PL b/Makefile.PL index 278cac7..73c7467 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -20,6 +20,7 @@ requires 'Data::OptList' => '0'; test_requires 'Test::More' => '0.77'; test_requires 'Test::Exception' => '0.21'; +test_requires 'Test::Output' => '0.09'; if ( -d '.svn' || -d '.git' || $ENV{IS_MAINTAINER} ) { system( $^X, 'author/extract-inline-tests' ); diff --git a/lib/Moose/Cookbook/Extending/Recipe3.pod b/lib/Moose/Cookbook/Extending/Recipe3.pod index 544a86f..1663b16 100644 --- a/lib/Moose/Cookbook/Extending/Recipe3.pod +++ b/lib/Moose/Cookbook/Extending/Recipe3.pod @@ -4,12 +4,7 @@ =begin testing-SETUP BEGIN { - eval 'use Test::Warn 0.11;'; - if ($@) { - diag 'Test::Warn 0.11+ is required for this test'; - ok(1); - exit 0; - } + use Test::Output; } =end testing-SETUP @@ -115,9 +110,9 @@ ok( Foo->isa('MyApp::Base'), 'Foo isa MyApp::Base' ); ok( Foo->can('size'), 'Foo has a size method' ); my $foo; -warning_is( +stderr_like( sub { $foo = Foo->new( size => 2 ) }, - 'Making a new Foo', + qr/^Making a new Foo/, 'got expected warning when calling Foo->new' ); diff --git a/t/010_basics/016_load_into_main.t b/t/010_basics/016_load_into_main.t index 683ae4b..015d7fe 100644 --- a/t/010_basics/016_load_into_main.t +++ b/t/010_basics/016_load_into_main.t @@ -3,13 +3,8 @@ use strict; use warnings; -use Test::More; - -BEGIN { - eval "use Test::Output;"; - plan skip_all => "Test::Output is required for this test" if $@; - plan tests => 2; -} +use Test::More tests => 2; +use Test::Output; stderr_is( sub { package main; eval 'use Moose' }, "Moose does not export its sugar to the 'main' package.\n", diff --git a/t/050_metaclasses/012_moose_exporter.t b/t/050_metaclasses/012_moose_exporter.t index 0389fd4..f4ab6cf 100644 --- a/t/050_metaclasses/012_moose_exporter.t +++ b/t/050_metaclasses/012_moose_exporter.t @@ -3,17 +3,9 @@ use strict; use warnings; -use Test::More; +use Test::More tests => 45; use Test::Exception; - -BEGIN { - unless ( eval 'use Test::Warn 0.11; 1' ) { - plan skip_all => 'These tests require Test::Warn 0.11'; - } - else { - plan tests => 45; - } -} +use Test::Output; { @@ -23,7 +15,7 @@ BEGIN { no Moose; - ::warning_is( sub { eval q[sub make_immutable { return 'foo' }] }, + ::stderr_is( sub { eval q[sub make_immutable { return 'foo' }] }, '', 'no warning when defining our own make_immutable sub' ); } diff --git a/t/300_immutable/010_constructor_is_not_moose.t b/t/300_immutable/010_constructor_is_not_moose.t index 882567c..bf2bfb4 100644 --- a/t/300_immutable/010_constructor_is_not_moose.t +++ b/t/300_immutable/010_constructor_is_not_moose.t @@ -3,12 +3,8 @@ use strict; use warnings; -use Test::More; - -eval "use Test::Output"; -plan skip_all => "Test::Output is required for this test" if $@; - -plan tests => 6; +use Test::More tests => 6; +use Test::Output; { package NotMoose; diff --git a/t/300_immutable/011_constructor_is_wrapped.t b/t/300_immutable/011_constructor_is_wrapped.t index f7f71b2..d5c1b3c 100644 --- a/t/300_immutable/011_constructor_is_wrapped.t +++ b/t/300_immutable/011_constructor_is_wrapped.t @@ -3,12 +3,8 @@ use strict; use warnings; -use Test::More; - -eval "use Test::Output"; -plan skip_all => "Test::Output is required for this test" if $@; - -plan tests => 1; +use Test::More tests => 1; +use Test::Output; { package ModdedNew; diff --git a/t/300_immutable/013_immutable_roundtrip.t b/t/300_immutable/013_immutable_roundtrip.t index fe39a34..27fd869 100644 --- a/t/300_immutable/013_immutable_roundtrip.t +++ b/t/300_immutable/013_immutable_roundtrip.t @@ -3,12 +3,8 @@ use strict; use warnings; -use Test::More; - -eval "use Test::Output"; -plan skip_all => "Test::Output is required for this test" if $@; - -plan tests => 1; +use Test::More tests => 1; +use Test::Output; { package Foo;