use Test::Requires in tests
[gitmo/Moose.git] / t / 300_immutable / 011_constructor_is_wrapped.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 use Test::Requires {
9     'Test::Output' => '0.01', # skip all if not installed
10 };
11
12 {
13     package ModdedNew;
14     use Moose;
15
16     before 'new' => sub { };
17 }
18
19 {
20     package Foo;
21     use Moose;
22
23     extends 'ModdedNew';
24
25     ::stderr_like(
26         sub { Foo->meta->make_immutable },
27         qr/\QNot inlining 'new' for Foo since it has method modifiers which would be lost if it were inlined/,
28         'got a warning that Foo may not have an inlined constructor'
29     );
30 }
31
32 done_testing;