Require Dist::Zilla 4.200016+
[gitmo/Moose.git] / t / attributes / default_undef.t
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use Test::More;
5 use Test::Moose;
6
7 {
8     package Foo;
9     use Moose;
10
11     has foo => (
12         is        => 'ro',
13         isa       => 'Maybe[Int]',
14         default   => undef,
15         predicate => 'has_foo',
16     );
17 }
18
19 with_immutable {
20     is(Foo->new->foo, undef);
21     ok(Foo->new->has_foo);
22 } 'Foo';
23
24 done_testing;