use Test::Fatal
[gitmo/MooseX-StrictConstructor.git] / t / instance.t
CommitLineData
d78f8e74 1use strict;
2use warnings;
3
4use Test::More;
5use Test::Moose qw( with_immutable );
a2edc419 6use Test::Fatal;
d78f8e74 7
8{
9 package Foo;
10 use Moose;
11 use MooseX::StrictConstructor;
12}
13
14with_immutable {
a2edc419 15 is(
16 exception { Foo->new( __INSTANCE__ => Foo->new ) },
17 undef,
18 '__INSTANCE__ is ignored when passed to ->new',
19 );
d78f8e74 20
a2edc419 21 is(
22 exception { Foo->meta->new_object( __INSTANCE__ => Foo->new ) },
23 undef,
24 '__INSTANCE__ is ignored when passed to ->new_object',
25 );
d78f8e74 26}
27'Foo';
28
29done_testing();