#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 6;
+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
do {
package ClassWithBUILD;
use Moose;
- with 'TestRole';
+
+ ::stderr_is {
+ with 'TestRole';
+ } '';
sub BUILD { push @CALLS, 'ClassWithBUILD::BUILD' }
};
do {
+ package ExplicitClassWithBUILD;
+ use Moose;
+
+ ::stderr_is {
+ with 'TestRole' => { excludes => 'BUILD' };
+ } '';
+
+ sub BUILD { push @CALLS, 'ExplicitClassWithBUILD::BUILD' }
+};
+
+do {
package ClassWithoutBUILD;
use Moose;
with 'TestRole';