X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F070_attribute_helpers%2F020_remove_attribute.t;h=dcd3df89037ba43150f97127a3878f1b211ec019;hb=a5209c2625a9f91cf03edd1134725d433cf11e6d;hp=08f4662ea3d91b94653b6d0b426d992fc64f615e;hpb=c13596ce8b488f81cf0e2a7624b9bbc612aa0346;p=gitmo%2FMoose.git diff --git a/t/070_attribute_helpers/020_remove_attribute.t b/t/070_attribute_helpers/020_remove_attribute.t index 08f4662..dcd3df8 100644 --- a/t/070_attribute_helpers/020_remove_attribute.t +++ b/t/070_attribute_helpers/020_remove_attribute.t @@ -3,23 +3,20 @@ use strict; use warnings; -use Test::More tests => 12; +use Test::More tests => 11; use Test::Exception; -BEGIN { - use_ok('Moose::AttributeHelpers'); -} - { package MyHomePage; use Moose; + use Moose::AttributeHelpers; has 'counter' => ( - traits => [ 'Counter' ], - is => 'ro', - isa => 'Int', - default => sub { 0 }, - handles => { + traits => ['Counter'], + is => 'ro', + isa => 'Int', + default => 0, + handles => { inc_counter => 'inc', dec_counter => 'dec', reset_counter => 'reset', @@ -28,9 +25,9 @@ BEGIN { } my $page = MyHomePage->new(); -isa_ok($page, 'MyHomePage'); +isa_ok( $page, 'MyHomePage' ); -can_ok($page, $_) for qw[ +can_ok( $page, $_ ) for qw[ counter dec_counter inc_counter @@ -38,17 +35,16 @@ can_ok($page, $_) for qw[ ]; lives_ok { - $page->meta->remove_attribute('counter') -} '... removed the counter attribute okay'; + $page->meta->remove_attribute('counter'); +} +'... removed the counter attribute okay'; -ok(!$page->meta->has_attribute('counter'), '... no longer has the attribute'); +ok( !$page->meta->has_attribute('counter'), + '... no longer has the attribute' ); -ok(!$page->can($_), "... our class no longer has the $_ method") for qw[ +ok( !$page->can($_), "... our class no longer has the $_ method" ) for qw[ counter dec_counter inc_counter reset_counter ]; - - -