From: Shawn M Moore Date: Wed, 16 Jul 2008 06:44:45 +0000 (+0000) Subject: Remove dependency on Test::Warn by catching the warning ourself in the one test file... X-Git-Tag: 0.19~238 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a7f212f16a8cf19b93f0ea30d91de08a810ee392;p=gitmo%2FMouse.git Remove dependency on Test::Warn by catching the warning ourself in the one test file we use it in --- diff --git a/Changes b/Changes index 19f76c7..c878cd9 100644 --- a/Changes +++ b/Changes @@ -21,6 +21,9 @@ Revision history for Mouse * Everywhere - Improvements to the MOP (e.g. Class->add_method) + * (build) + - Excise dependency on Test::Warn, we only used it in one simple test + 0.04 Tue Jun 17 04:56:36 2008 * Mouse Mouse::Meta::Attribute diff --git a/Makefile.PL b/Makefile.PL index 0dded4f..2ea5ca2 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -10,7 +10,6 @@ requires 'Class::Method::Modifiers' => '1.01'; build_requires 'Test::More'; build_requires 'Test::Exception'; -build_requires 'Test::Warn'; WriteAll; diff --git a/t/002-warnings.t b/t/002-warnings.t index 4d57726..f5195aa 100644 --- a/t/002-warnings.t +++ b/t/002-warnings.t @@ -1,11 +1,20 @@ #!/usr/bin/env perl use Test::More tests => 1; -use Test::Warn; -warning_like { +# we used to use Test::Warn here but there's no point in adding three deps total +# for this one easy test + +my @warnings; +local $SIG{__WARN__} = sub { + push @warnings, "@_"; +}; + +do { package Class; use Mouse; my $one = 1 + undef; -} qr/uninitialized value/, 'using Mouse turns on warnings'; +}; + +like("@warnings", qr/^Use of uninitialized value/, 'using Mouse turns on warnings');