#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 10;
+use Test::More tests => 8;
use Test::Output;
# this test script ensures that my idiom of:
package ClassWithBUILD;
use Moose;
- ::stderr_like {
+ ::stderr_is {
with 'TestRole';
- } qr/The ClassWithBUILD class has implicitly overridden the method \(BUILD\) from role TestRole\./;
+ } '';
sub BUILD { push @CALLS, 'ClassWithBUILD::BUILD' }
};
'TestRole::BUILD:after',
]);
- ExplicitClassWithBUILD->new;
-
- is_deeply([splice @CALLS], [
- 'TestRole::BUILD:before',
- 'ExplicitClassWithBUILD::BUILD',
- 'TestRole::BUILD:after',
- ]);
-
ClassWithoutBUILD->new;
is_deeply([splice @CALLS], [
if (ClassWithBUILD->meta->is_mutable) {
ClassWithBUILD->meta->make_immutable;
- ExplicitClassWithBUILD->meta->make_immutable;
ClassWithoutBUILD->meta->make_immutable;
redo;
}