'Carp' => '0.01',
'B' => '0',
},
- optional => {
- 'Digest::MD5' => '0'
- },
+ optional => {},
build_requires => {
'Test::More' => '0.47',
'Test::Exception' => '0.21',
---------------------------- ------ ------ ------ ------ ------ ------ ------
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
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
[ $Baz->class_precedence_list ],
[ 'Baz', 'Bar', 'Foo', 'UNIVERSAL' ],
'... Baz->class_precedence_list == (Baz, Bar, Foo, UNIVERSAL)');
+
use strict;
use warnings;
-use Test::More tests => 18;
+use Test::More tests => 19;
use Test::Exception;
BEGIN {
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');