use done_testing
[gitmo/MooseX-ClassAttribute.git] / t / 09-bare-native-traits.t
1 # reported in https://rt.cpan.org/Public/Bug/Display.html?id=59573
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7 use Test::Fatal;
8
9 {
10     package Foo;
11
12     use Moose;
13     use MooseX::ClassAttribute;
14
15     class_has attr => (
16         is      => 'bare',
17         isa     => 'HashRef[Str]',
18         lazy    => 1,
19         default => sub { {} },
20         traits  => ['Hash'],
21         handles => {
22             has_attr => 'exists',
23         },
24     );
25 }
26
27 is(
28     exception { Foo->has_attr('key') },
29     undef,
30     'Default builder in a native attribute trait is properly run when the attribute is defined with no standard accessors'
31 );
32
33 done_testing();