Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 020_attributes / 015_attribute_traits.t
index 4197708..baf3eb8 100644 (file)
@@ -1,15 +1,16 @@
 #!/usr/bin/perl
-use lib 't/lib';
+# This is automatically generated by author/import-moose-test.pl.
+# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
+use t::lib::MooseCompat;
 
 use strict;
 use warnings;
 
-use Test::More tests => 12;
+use Test::More;
 use Test::Exception;
 use Test::Mouse;
 
 
-
 {
     package My::Attribute::Trait;
     use Mouse::Role;
@@ -20,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
         );
     };
 }
@@ -57,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');
@@ -68,5 +66,4 @@ ok(!$gorch_attr->does('My::Attribute::Trait'), '... gorch doesnt do the trait');
 ok(!$gorch_attr->has_applied_traits, '... no traits applied');
 is($gorch_attr->applied_traits, undef, '... no traits applied');
 
-
-
+done_testing;