X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcmop%2Funiversal_methods.t;h=0d3d6463365bf22c0467e92722af4988ec758142;hb=db31d100fb6cd8d260452ce3156fa8411b9936c5;hp=29d94dfc5feb04de641020ce125c5972d23cab83;hpb=829433c47061dd70a608bfcd940113c4172b6950;p=gitmo%2FMoose.git diff --git a/t/cmop/universal_methods.t b/t/cmop/universal_methods.t index 29d94df..0d3d646 100644 --- a/t/cmop/universal_methods.t +++ b/t/cmop/universal_methods.t @@ -1,24 +1,38 @@ -#!perl - use strict; use warnings; -# UNIVERSAL methods - use Test::More; use Class::MOP; my $meta_class = Class::MOP::Class->create_anon_class; +my %methods = map { $_->name => 1 } $meta_class->get_all_methods(); +my %method_names = map { $_ => 1 } $meta_class->get_all_method_names(); + my @universal_methods = qw/isa can VERSION/; push @universal_methods, 'DOES' if $] >= 5.010; -TODO: { - local $TODO = 'UNIVERSAL methods should be available'; - - for my $method ( @universal_methods ) { - ok $meta_class->find_method_by_name($method), "has UNIVERSAL method $method"; - } -}; +for my $method (@universal_methods) { + ok( + $meta_class->find_method_by_name($method), + "find_method_by_name finds UNIVERSAL method $method" + ); + ok( + $meta_class->find_next_method_by_name($method), + "find_next_method_by_name finds UNIVERSAL method $method" + ); + ok( + scalar $meta_class->find_all_methods_by_name($method), + "find_all_methods_by_name finds UNIVERSAL method $method" + ); + ok( + $methods{$method}, + "get_all_methods includes $method from UNIVERSAL" + ); + ok( + $method_names{$method}, + "get_all_method_names includes $method from UNIVERSAL" + ); +} done_testing;