6 use Test::More no_plan => 1;
9 use_ok('MooseX::AttributeHelpers');
17 metaclass => 'Counter',
28 my $page = MyHomePage->new();
29 isa_ok($page, 'MyHomePage');
31 can_ok($page, $_) for qw[
36 is($page->counter, 0, '... got the default value');
39 is($page->counter, 1, '... got the incremented value');
42 is($page->counter, 2, '... got the incremented value (again)');
45 is($page->counter, 1, '... got the decremented value');
49 my $counter = $page->meta->get_attribute('counter');
50 isa_ok($counter, 'MooseX::AttributeHelpers::Counter');
52 is($counter->helper_type, 'Num', '... got the expected helper type');
54 is($counter->type_constraint->name, 'Int', '... got the expected type constraint');
56 is_deeply($counter->provides, {
59 }, '... got the right provides methods');