Add another MOOSE_TEST_MD option, MooseX
[gitmo/Moose.git] / t / cmop / universal_methods.t
CommitLineData
38bf2a25 1use strict;
2use warnings;
3
38bf2a25 4use Test::More;
5use Class::MOP;
6
7my $meta_class = Class::MOP::Class->create_anon_class;
8
928330d8 9my %methods = map { $_->name => 1 } $meta_class->get_all_methods();
10my %method_names = map { $_ => 1 } $meta_class->get_all_method_names();
11
38bf2a25 12my @universal_methods = qw/isa can VERSION/;
13push @universal_methods, 'DOES' if $] >= 5.010;
14
928330d8 15for my $method (@universal_methods) {
16 ok(
17 $meta_class->find_method_by_name($method),
18 "find_method_by_name finds UNIVERSAL method $method"
19 );
20 ok(
21 $meta_class->find_next_method_by_name($method),
22 "find_next_method_by_name finds UNIVERSAL method $method"
23 );
24 ok(
25 scalar $meta_class->find_all_methods_by_name($method),
26 "find_all_methods_by_name finds UNIVERSAL method $method"
27 );
28 ok(
29 $methods{$method},
30 "get_all_methods includes $method from UNIVERSAL"
31 );
32 ok(
33 $method_names{$method},
34 "get_all_method_names includes $method from UNIVERSAL"
35 );
36}
38bf2a25 37
38done_testing;