From: Shawn M Moore Date: Tue, 21 Apr 2009 07:20:33 +0000 (-0400) Subject: More composition warning tests, oops X-Git-Tag: 0.75_01~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e394f5e70d7715b807156e5b102b20c4f189f65a;p=gitmo%2FMoose.git More composition warning tests, oops --- diff --git a/t/030_roles/019_build.t b/t/030_roles/019_build.t index ce0bce5..3e65149 100644 --- a/t/030_roles/019_build.t +++ b/t/030_roles/019_build.t @@ -1,7 +1,8 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 8; +use Test::More tests => 10; +use Test::Output; # this test script ensures that my idiom of: # role: sub BUILD, after BUILD @@ -22,7 +23,10 @@ do { do { package ClassWithBUILD; use Moose; - with 'TestRole'; + + ::stderr_like { + with 'TestRole'; + } qr/The ClassWithBUILD class has implicitly overridden the method \(BUILD\) from role TestRole\./; sub BUILD { push @CALLS, 'ClassWithBUILD::BUILD' } }; @@ -30,7 +34,10 @@ do { do { package ExplicitClassWithBUILD; use Moose; - with 'TestRole' => { excludes => 'BUILD' }; + + ::stderr_is { + with 'TestRole' => { excludes => 'BUILD' }; + } ''; sub BUILD { push @CALLS, 'ExplicitClassWithBUILD::BUILD' } };