From: Shawn M Moore Date: Fri, 13 Jun 2008 01:47:50 +0000 (+0000) Subject: tests for has_attribute X-Git-Tag: 0.04~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=986ff64a687422cb30c365f856ec2c5018b489e4 tests for has_attribute --- diff --git a/t/100-meta-class.t b/t/100-meta-class.t index 8e3ee31..b90c6ca 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 => 14; do { package Class; @@ -25,6 +25,7 @@ is($meta, $meta2, "same metaclass instance"); can_ok($meta, 'name', 'get_attribute_map'); +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,8 @@ is($attr->name, 'pawn', 'got the correct attribute'); my $map = $meta->get_attribute_map; is_deeply($map, { pawn => $attr }, "attribute map"); +ok(!$meta->has_attribute('nonexistent_attribute')); + eval " package Class; use Mouse;