Commit | Line | Data |
---|---|---|
ed10982f | 1 | use strict; |
2 | use warnings; | |
3 | ||
3272340d | 4 | use Test::More tests => 2; |
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', | |
15 | handles => { | |
16 | inc_counter => 'inc', | |
17 | }, | |
18 | ); | |
19 | } | |
20 | ||
21 | is( MyClass->counter(), 0 ); | |
22 | ||
23 | MyClass->inc_counter(); | |
24 | is( MyClass->counter(), 1 ); | |
ee29de7b | 25 |