2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
10 $TODO = q{Mouse is not yet completed};
11 use Test::Mouse 'does_ok';
18 traits => ['Counter'],
25 reset_counter => 'reset',
31 my $page = MyHomePage->new();
32 isa_ok( $page, 'MyHomePage' );
34 can_ok( $page, $_ ) for qw[
41 is( $page->counter, 0, '... got the default value' );
44 is( $page->counter, 1, '... got the incremented value' );
47 is( $page->counter, 2, '... got the incremented value (again)' );
50 is( $page->counter, 1, '... got the decremented value' );
53 is( $page->counter, 0, '... got the original value' );
55 $page->set_counter(5);
56 is( $page->counter, 5, '... set the value' );
58 $page->inc_counter(2);
59 is( $page->counter, 7, '... increment by arg' );
61 $page->dec_counter(5);
62 is( $page->counter, 2, '... decrement by arg' );
66 my $counter = $page->meta->get_attribute('counter');
67 does_ok( $counter, 'Mouse::Meta::Attribute::Native::Trait::Counter' );
69 is( $counter->type_constraint->name, 'Int',
70 '... got the expected type constraint' );
77 reset_counter => 'reset',
80 '... got the right handles methods'