Commit | Line | Data |
---|---|---|
29c02565 | 1 | use strict; |
2 | use warnings; | |
fefc111f | 3 | |
29c02565 | 4 | use Test::More tests => 2; |
5 | ||
fefc111f | 6 | { |
29c02565 | 7 | package MyClass; |
fefc111f | 8 | |
29c02565 | 9 | use MooseX::ClassAttribute; |
10 | use MooseX::AttributeHelpers; | |
11 | ||
fefc111f | 12 | class_has counter => |
13 | ( metaclass => 'Counter', | |
14 | is => 'ro', | |
15 | provides => { inc => 'inc_counter', | |
16 | }, | |
17 | ); | |
18 | } | |
29c02565 | 19 | |
fefc111f | 20 | is( MyClass->counter(), 0 ); |
29c02565 | 21 | |
fefc111f | 22 | MyClass->inc_counter(); |
23 | is( MyClass->counter(), 1 ); |