#!/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
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' }
};
do {
package ExplicitClassWithBUILD;
use Moose;
- with 'TestRole' => { excludes => 'BUILD' };
+
+ ::stderr_is {
+ with 'TestRole' => { excludes => 'BUILD' };
+ } '';
sub BUILD { push @CALLS, 'ExplicitClassWithBUILD::BUILD' }
};