6 use Test::More tests => 14;
9 use_ok('MooseX::AttributeHelpers');
16 has 'counter' => (metaclass => 'Counter');
19 my $page = MyHomePage->new();
20 isa_ok($page, 'MyHomePage');
22 can_ok($page, $_) for qw[
28 is($page->counter, 0, '... got the default value');
31 is($page->counter, 1, '... got the incremented value');
34 is($page->counter, 2, '... got the incremented value (again)');
37 is($page->counter, 1, '... got the decremented value');
40 is($page->counter, 0, '... got the original value');
44 my $counter = $page->meta->get_attribute('counter');
45 isa_ok($counter, 'MooseX::AttributeHelpers::Counter');
47 is($counter->helper_type, 'Num', '... got the expected helper type');
49 is($counter->type_constraint->name, 'Num', '... got the expected default type constraint');
51 is_deeply($counter->provides, {
54 reset => 'reset_counter',
56 }, '... got the right default provides methods');