No need to call Moose->init_meta in here
[gitmo/MooseX-ClassAttribute.git] / t / 05-with-attribute-helpers-backcompat.t
CommitLineData
9924122d 1use strict;
2use warnings;
3
4use Test::More;
5
6BEGIN {
7 eval "use MooseX::AttributeHelpers 0.13;";
8 plan skip_all => 'This test requires MooseX::AttributeHelpers 0.13+'
9 if $@;
10}
11
12{
13 package MyClass;
14
15 use MooseX::ClassAttribute;
16 use MooseX::AttributeHelpers;
17
18 class_has counter =>
19 ( metaclass => 'Counter',
20 is => 'ro',
21 provides => { inc => 'inc_counter',
22 },
23 );
24}
25
26is( MyClass->counter(), 0 );
27
28MyClass->inc_counter();
29is( MyClass->counter(), 1 );
30
31done_testing();