Unconditionally depend on Test::Output; dropping Test::Warn
[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 tests => 1;
7 use Test::Output;
8
9 {
10     package ModdedNew;
11     use Moose;
12
13     before 'new' => sub { };
14 }
15
16 {
17     package Foo;
18     use Moose;
19
20     extends 'ModdedNew';
21
22     ::stderr_is(
23         sub { Foo->meta->make_immutable },
24         "Not inlining 'new' for Foo since it is not inheriting the default Moose::Object::new\nIf you are certain you don't need to inline your constructor, specify inline_constructor => 0 in your call to Foo->meta->make_immutable\n ('new' has method modifiers which would be lost if it were inlined)\n",
25         'got a warning that Foo may not have an inlined constructor'
26     );
27 }