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