Commit | Line | Data |
81766020 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
3d659f7f |
6 | use Test::More; |
7 | BEGIN { |
8 | eval "use Test::Output;"; |
9 | plan skip_all => "Test::Output is required for this test" if $@; |
10 | plan tests => 1; |
11 | } |
81766020 |
12 | |
13 | { |
14 | package ModdedNew; |
15 | use Moose; |
16 | |
17 | before 'new' => sub { }; |
18 | } |
19 | |
20 | { |
21 | package Foo; |
22 | use Moose; |
23 | |
24 | extends 'ModdedNew'; |
25 | |
eedb62c7 |
26 | ::stderr_like( |
81766020 |
27 | sub { Foo->meta->make_immutable }, |
eedb62c7 |
28 | qr/\QNot inlining 'new' for Foo since it is not inheriting the default Moose::Object::new\E\s+\QIf you are certain you don't need to inline your constructor, specify inline_constructor => 0 in your call to Foo->meta->make_immutable\E\s+\Q ('new' has method modifiers which would be lost if it were inlined)/, |
81766020 |
29 | 'got a warning that Foo may not have an inlined constructor' |
30 | ); |
31 | } |