X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=t%2F020_attributes%2F015_attribute_traits.t;h=675d22ceab903407249d67254cfb010699e6b858;hp=2c557ca166d3803eff5bcaf42f07d6b98832d392;hb=410c35639fa6a9e13fbed562d087d09de375f5a0;hpb=4fcab48881ecd200c3d83d563fccda833fdc5c28 diff --git a/t/020_attributes/015_attribute_traits.t b/t/020_attributes/015_attribute_traits.t index 2c557ca..675d22c 100644 --- a/t/020_attributes/015_attribute_traits.t +++ b/t/020_attributes/015_attribute_traits.t @@ -1,22 +1,15 @@ #!/usr/bin/perl -use lib 't/lib'; use strict; use warnings; -use Test::More; -BEGIN{ - if(eval{ require Class::Method::Modifiers::Fast } || eval{ require Class::Method::Modifiers }){ - plan tests => 12; - } - else{ - plan skip_all => 'This test requires Class::Method::Modifiers(::Fast)?'; - } -} +use lib 't/lib'; + +use Test::More tests => 12; use Test::Exception; use Test::Mouse; - +use MooseCompat; { package My::Attribute::Trait; @@ -28,11 +21,9 @@ use Test::Mouse; after 'install_accessors' => sub { my $self = shift; - my $reader = $self->get_read_method; - $self->associated_class->add_method( $self->alias_to, - sub { shift->$reader(@_) }, + $self->get_read_method_ref ); }; } @@ -65,7 +56,6 @@ can_ok($c, 'baz'); is($c->baz, 100, '... got the right value for baz'); my $bar_attr = $c->meta->get_attribute('bar'); - does_ok($bar_attr, 'My::Attribute::Trait'); ok($bar_attr->has_applied_traits, '... got the applied traits'); is_deeply($bar_attr->applied_traits, [qw/My::Attribute::Trait/], '... got the applied traits');