1Test::Mouse(3) User Contributed Perl Documentation Test::Mouse(3)
2
3
4
6 Test::Mouse - Test functions for Mouse specific features
7
9 use Test::More plan => 1;
10 use Test::Mouse;
11
12 meta_ok($class_or_obj, "... Foo has a ->meta");
13 does_ok($class_or_obj, $role, "... Foo does the Baz role");
14 has_attribute_ok($class_or_obj, $attr_name, "... Foo has the 'bar' attribute");
15
17 This module provides some useful test functions for Mouse based
18 classes. It is an experimental first release, so comments and
19 suggestions are very welcome.
20
22 meta_ok ($class_or_object)
23 Tests if a class or object has a metaclass.
24
25 does_ok ($class_or_object, $role, ?$message)
26 Tests if a class or object does a certain role, similar to what
27 "isa_ok" does for the "isa" method.
28
29 has_attribute_ok($class_or_object, $attr_name, ?$message)
30 Tests if a class or object has a certain attribute, similar to what
31 "can_ok" does for the methods.
32
34 Test::More
35
37 Mouse
38
39 Test::Moose
40
41
42
43perl v5.12.0 2010-03-12 Test::Mouse(3)