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, 'inc_counter');
32 can_ok($page, 'dec_counter');
34 is($page->counter, 0, '... got the default value');
37 is($page->counter, 1, '... got the incremented value');
40 is($page->counter, 2, '... got the incremented value (again)');
43 is($page->counter, 1, '... got the decremented value');
47 my $counter = $page->meta->get_attribute('counter');
48 isa_ok($counter, 'MooseX::AttributeHelpers::Counter');
50 is($counter->helper_type, 'Num', '... got the expected helper type');
52 is($counter->type_constraint->name, 'Int', '... got the expected type constraint');
54 is_deeply($counter->provides, {
57 }, '... got the right provides methods');