X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F100-meta-class.t;h=264a81ec5c7b5b71174c45123d49d9bf8f80d958;hb=73766a27db7dcd127e0397d83186dadfcda398a9;hp=8e3ee3106567845b34ecb8d88844688ab385581f;hpb=306290e864ac23e5f1692c8495b0c173081a1ebb;p=gitmo%2FMouse.git diff --git a/t/100-meta-class.t b/t/100-meta-class.t index 8e3ee31..264a81e 100644 --- a/t/100-meta-class.t +++ b/t/100-meta-class.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 12; +use Test::More tests => 15; do { package Class; @@ -23,8 +23,9 @@ is_deeply([$meta->superclasses], ['Mouse::Object'], "correctly inherting from Mo my $meta2 = Class->meta; is($meta, $meta2, "same metaclass instance"); -can_ok($meta, 'name', 'get_attribute_map'); +can_ok($meta, 'name', 'get_attribute_map', 'get_attribute_list'); +ok($meta->has_attribute('pawn')); my $attr = $meta->get_attribute('pawn'); isa_ok($attr, 'Mouse::Meta::Attribute'); is($attr->name, 'pawn', 'got the correct attribute'); @@ -32,6 +33,11 @@ is($attr->name, 'pawn', 'got the correct attribute'); my $map = $meta->get_attribute_map; is_deeply($map, { pawn => $attr }, "attribute map"); +my $list = [$meta->get_attribute_list]; +is_deeply($list, [ 'pawn' ], "attribute list"); + +ok(!$meta->has_attribute('nonexistent_attribute')); + eval " package Class; use Mouse;