the repository now lives at https://github.com/moose/MooseX-ClassAttributes
[gitmo/MooseX-ClassAttribute.git] / t / 04-with-native-traits.t
CommitLineData
ed10982f 1use strict;
2use warnings;
3
d4e5a2f2 4use Test::More;
ed10982f 5
6{
7 package MyClass;
8
deaffdd0 9 use Moose;
ed10982f 10 use MooseX::ClassAttribute;
11
12 class_has counter => (
13 traits => ['Counter'],
14 is => 'ro',
b6819869 15 default => 0,
ed10982f 16 handles => {
17 inc_counter => 'inc',
18 },
19 );
20}
21
22is( MyClass->counter(), 0 );
23
24MyClass->inc_counter();
25is( MyClass->counter(), 1 );
ee29de7b 26
d4e5a2f2 27done_testing();