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