projects
/
gitmo/Mouse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
0fc8adb
)
Make has_attribute actually work
Shawn M Moore [Tue, 17 Jun 2008 03:38:52 +0000 (
03:38
+0000)]
lib/Mouse/Meta/Role.pm
patch
|
blob
|
blame
|
history
t/401-meta-role.t
patch
|
blob
|
blame
|
history
diff --git
a/lib/Mouse/Meta/Role.pm
b/lib/Mouse/Meta/Role.pm
index
927945a
..
92b39c1
100644
(file)
--- a/
lib/Mouse/Meta/Role.pm
+++ b/
lib/Mouse/Meta/Role.pm
@@
-32,11
+32,8
@@
sub new {
sub name { $_[0]->{name} }
-sub has_attribute { }
-
-sub add_attribute {
- $_[0]->{attributes}->{$_[1]} = $_[2];
-}
+sub has_attribute { exists $_[0]->{attributes}->{$_[1]} }
+sub add_attribute { $_[0]->{attributes}->{$_[1]} = $_[2] }
1;
diff --git
a/t/401-meta-role.t
b/t/401-meta-role.t
index
8816a8c
..
85a6dc2
100644
(file)
--- a/
t/401-meta-role.t
+++ b/
t/401-meta-role.t
@@
-1,7
+1,7
@@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 3;
+use Test::More tests => 5;
do {
package Role;