From: Stevan Little Date: Thu, 20 Apr 2006 18:31:04 +0000 (+0000) Subject: fixes X-Git-Tag: 0_26~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d41e86f212230a7ddd87c1566d7f4dbe246d750c;p=gitmo%2FClass-MOP.git fixes --- diff --git a/Build.PL b/Build.PL index e6813e2..3a32dab 100644 --- a/Build.PL +++ b/Build.PL @@ -11,9 +11,7 @@ my $build = Module::Build->new( 'Carp' => '0.01', 'B' => '0', }, - optional => { - 'Digest::MD5' => '0' - }, + optional => {}, build_requires => { 'Test::More' => '0.47', 'Test::Exception' => '0.21', diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index 49cea2e..866e6e8 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -406,13 +406,13 @@ L report on this module's test suite. ---------------------------- ------ ------ ------ ------ ------ ------ ------ File stmt bran cond sub pod time total ---------------------------- ------ ------ ------ ------ ------ ------ ------ - Class/MOP.pm 100.0 100.0 100.0 100.0 n/a 21.4 100.0 - Class/MOP/Attribute.pm 100.0 100.0 88.9 100.0 100.0 27.1 99.3 - Class/MOP/Class.pm 100.0 100.0 93.7 100.0 100.0 44.8 99.1 - Class/MOP/Method.pm 100.0 100.0 83.3 100.0 100.0 4.8 97.1 - metaclass.pm 100.0 100.0 80.0 100.0 n/a 1.9 97.3 + Class/MOP.pm 100.0 100.0 100.0 100.0 n/a 10.5 100.0 + Class/MOP/Attribute.pm 100.0 100.0 91.7 73.8 100.0 30.3 92.1 + Class/MOP/Class.pm 99.6 93.5 82.3 98.2 100.0 52.5 95.5 + Class/MOP/Method.pm 100.0 53.6 52.9 80.0 100.0 5.4 83.3 + metaclass.pm 100.0 100.0 80.0 100.0 n/a 1.4 97.4 ---------------------------- ------ ------ ------ ------ ------ ------ ------ - Total 100.0 100.0 92.2 100.0 100.0 100.0 99.0 + Total 99.8 89.3 79.7 86.2 100.0 100.0 93.3 ---------------------------- ------ ------ ------ ------ ------ ------ ------ =head1 ACKNOWLEDGEMENTS diff --git a/t/000_load.t b/t/000_load.t index b9311a2..a636b7e 100644 --- a/t/000_load.t +++ b/t/000_load.t @@ -3,11 +3,34 @@ use strict; use warnings; -use Test::More tests => 4; +use Test::More tests => 7; BEGIN { use_ok('Class::MOP'); use_ok('Class::MOP::Class'); use_ok('Class::MOP::Attribute'); use_ok('Class::MOP::Method'); -} \ No newline at end of file +} + +# make sure we are tracking metaclasses correctly + +my %METAS = ( + 'Class::MOP::Attribute' => Class::MOP::Attribute->meta, + 'Class::MOP::Class' => Class::MOP::Class->meta, + 'Class::MOP::Method' => Class::MOP::Method->meta +); + +is_deeply( + { Class::MOP::Class->get_all_metaclasses }, + \%METAS, + '... got all the metaclasses'); + +is_deeply( + [ sort { $a->name cmp $b->name } Class::MOP::Class->get_all_metaclass_instances ], + [ Class::MOP::Attribute->meta, Class::MOP::Class->meta, Class::MOP::Method->meta ], + '... got all the metaclass instances'); + +is_deeply( + [ sort Class::MOP::Class->get_all_metaclass_names ], + [ 'Class::MOP::Attribute', 'Class::MOP::Class', 'Class::MOP::Method' ], + '... got all the metaclass names'); \ No newline at end of file diff --git a/t/001_basic.t b/t/001_basic.t index 6eec2d7..a4b837c 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -67,3 +67,4 @@ is_deeply( [ $Baz->class_precedence_list ], [ 'Baz', 'Bar', 'Foo', 'UNIVERSAL' ], '... Baz->class_precedence_list == (Baz, Bar, Foo, UNIVERSAL)'); + diff --git a/t/030_method.t b/t/030_method.t index 2f246a9..89bc93e 100644 --- a/t/030_method.t +++ b/t/030_method.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 18; +use Test::More tests => 19; use Test::Exception; BEGIN { @@ -16,6 +16,7 @@ is($method->meta, Class::MOP::Method->meta, '... instance and class both lead to is($method->package_name, 'main', '... our package is main::'); is($method->name, '__ANON__', '... our sub name is __ANON__'); +is($method->fully_qualified_name, 'main::__ANON__', '... our subs full name is main::__ANON__'); my $meta = Class::MOP::Method->meta; isa_ok($meta, 'Class::MOP::Class');