Commit | Line | Data |
---|---|---|
9924122d | 1 | use strict; |
2 | use warnings; | |
3 | ||
d4e5a2f2 | 4 | use Test::More; |
3272340d | 5 | |
6bf506c8 | 6 | use Test::Requires 0.05 { |
287f2b9d | 7 | 'MooseX::AttributeHelpers' => 0.23, |
3272340d | 8 | }; |
9924122d | 9 | |
9924122d | 10 | { |
11 | package MyClass; | |
12 | ||
deaffdd0 | 13 | use Moose; |
9924122d | 14 | use MooseX::ClassAttribute; |
15 | use MooseX::AttributeHelpers; | |
16 | ||
3e9e5aef | 17 | class_has counter => ( |
18 | metaclass => 'Counter', | |
19 | is => 'ro', | |
20 | provides => { | |
21 | inc => 'inc_counter', | |
22 | }, | |
23 | ); | |
9924122d | 24 | } |
25 | ||
26 | is( MyClass->counter(), 0 ); | |
27 | ||
28 | MyClass->inc_counter(); | |
29 | is( MyClass->counter(), 1 ); | |
30 | ||
d4e5a2f2 | 31 | done_testing(); |