X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F014_attribute_introspection.t;h=112b9c0810258c800d2d19f9e5fbd31834765145;hb=5efa6a46982d17e1ff642e8b97673c6618fa7e6d;hp=d221389646ff0133e9d43bdc02628c79b0088b85;hpb=86a4d8730cfe673db674c692f7703632b700c7c9;p=gitmo%2FClass-MOP.git diff --git a/t/014_attribute_introspection.t b/t/014_attribute_introspection.t index d221389..112b9c0 100644 --- a/t/014_attribute_introspection.t +++ b/t/014_attribute_introspection.t @@ -2,18 +2,19 @@ use strict; use warnings; use Test::More; -use Test::Exception; +use Test::Fatal; use Class::MOP; { my $attr = Class::MOP::Attribute->new('$test'); - is($attr->meta, Class::MOP::Attribute->meta, '... instance and class both lead to the same meta'); + is( $attr->meta, Class::MOP::Attribute->meta, + '... instance and class both lead to the same meta' ); } { my $meta = Class::MOP::Attribute->meta(); - isa_ok($meta, 'Class::MOP::Class'); + isa_ok( $meta, 'Class::MOP::Class' ); my @methods = qw( new @@ -61,16 +62,26 @@ use Class::MOP; install_accessors remove_accessors + inline_get + inline_set + inline_has + inline_clear + _new - ); + ); is_deeply( - [ sort $meta->get_method_list ], + [ + sort Class::MOP::Mixin::AttributeCore->meta->get_method_list, + $meta->get_method_list + ], [ sort @methods ], - '... our method list matches'); + '... our method list matches' + ); foreach my $method_name (@methods) { - ok($meta->has_method($method_name), '... Class::MOP::Attribute->has_method(' . $method_name . ')'); + ok( $meta->find_method_by_name($method_name), + '... Class::MOP::Attribute->find_method_by_name(' . $method_name . ')' ); } my @attributes = ( @@ -91,12 +102,19 @@ use Class::MOP; ); is_deeply( - [ sort $meta->get_attribute_list ], + [ + sort Class::MOP::Mixin::AttributeCore->meta->get_attribute_list, + $meta->get_attribute_list + ], [ sort @attributes ], - '... our attribute list matches'); + '... our attribute list matches' + ); foreach my $attribute_name (@attributes) { - ok($meta->has_attribute($attribute_name), '... Class::MOP::Attribute->has_attribute(' . $attribute_name . ')'); + ok( $meta->find_attribute_by_name($attribute_name), + '... Class::MOP::Attribute->find_attribute_by_name(' + . $attribute_name + . ')' ); } # We could add some tests here to make sure that