Make Test::Output optional again
[gitmo/Moose.git] / t / 300_immutable / 011_constructor_is_wrapped.t
CommitLineData
81766020 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
3d659f7f 6use Test::More;
7BEGIN {
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
26 ::stderr_is(
27 sub { Foo->meta->make_immutable },
0fa70d03 28 "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",
81766020 29 'got a warning that Foo may not have an inlined constructor'
30 );
31}