6 use Test::More tests => 14;
8 # We just want the class definitions in here.
12 HasClassAttribute->meta()->has_class_attribute('ObjectCount'),
13 q{has_class_attribute('ObjectCount') returns true}
17 HasClassAttribute->meta()->get_class_attribute('ObjectCount')->meta()
18 ->does_role('MooseX::ClassAttribute::Role::Meta::Attribute'),
19 'get_class_attribute_list returns an object which does the MooseX::ClassAttribute::Role::Meta::Attribute role'
22 my @ca = qw( Delegatee
35 [ sort HasClassAttribute->meta()->get_class_attribute_list() ],
37 'HasClassAttribute get_class_attribute_list gets all class attributes'
42 sort map { $_->name() }
43 HasClassAttribute->meta()->get_all_attributes()
46 'HasClassAttribute get_all_attributes only finds size attribute'
51 sort map { $_->name() }
52 HasClassAttribute->meta()->get_all_class_attributes()
55 'HasClassAttribute get_all_class_attributes gets all class attributes'
59 [ sort keys %{ HasClassAttribute->meta()->get_class_attribute_map() } ],
61 'HasClassAttribute get_class_attribute_map gets all class attributes'
65 [ sort map { $_->name() } Child->meta()->get_all_class_attributes() ],
66 [ sort ( @ca, 'YetAnotherAttribute' ) ],
67 'Child get_class_attribute_map gets all class attributes'
71 !Child->meta()->has_class_attribute('ObjectCount'),
72 q{has_class_attribute('ObjectCount') returns false for Child}
76 Child->meta()->has_class_attribute('YetAnotherAttribute'),
77 q{has_class_attribute('YetAnotherAttribute') returns true for Child}
81 Child->can('YetAnotherAttribute'),
82 'Child has accessor for YetAnotherAttribute'
86 Child->meta()->has_class_attribute_value('YetAnotherAttribute'),
87 'Child has class attribute value for YetAnotherAttribute'
90 Child->meta()->remove_class_attribute('YetAnotherAttribute');
93 !Child->meta()->has_class_attribute('YetAnotherAttribute'),
94 q{... has_class_attribute('YetAnotherAttribute') returns false after remove_class_attribute}
98 !Child->can('YetAnotherAttribute'),
99 'accessor for YetAnotherAttribute has been removed'
103 !Child->meta()->has_class_attribute_value('YetAnotherAttribute'),
104 'Child does not have a class attribute value for YetAnotherAttribute'