---------------------------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
---------------------------- ------ ------ ------ ------ ------ ------ ------
- 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
+ Class/MOP.pm 100.0 100.0 100.0 100.0 n/a 9.6 100.0
+ Class/MOP/Attribute.pm 100.0 100.0 91.7 73.8 100.0 28.4 92.1
+ Class/MOP/Class.pm 100.0 93.5 82.3 98.2 100.0 56.6 95.7
+ Class/MOP/Method.pm 100.0 64.3 52.9 80.0 100.0 3.5 85.3
+ metaclass.pm 100.0 100.0 80.0 100.0 n/a 1.9 97.4
---------------------------- ------ ------ ------ ------ ------ ------ ------
- Total 99.8 89.3 79.7 86.2 100.0 100.0 93.3
+ Total 100.0 90.8 79.7 86.2 100.0 100.0 93.6
---------------------------- ------ ------ ------ ------ ------ ------ ------
=head1 ACKNOWLEDGEMENTS
use strict;
use warnings;
-use Test::More tests => 9;
+use Test::More tests => 14;
use Test::Exception;
BEGIN {
sub foobarbaz { 'Foo::Bar::Baz::foobarbaz' }
}
+ok(!defined(Class::MOP::Class->initialize('Foo')->find_next_method_by_name('BUILD')),
+ '... Foo::BUILD has not next method');
+
+is(Class::MOP::Class->initialize('Bar')->find_next_method_by_name('BUILD'),
+ Class::MOP::Class->initialize('Foo')->get_method('BUILD'),
+ '... Bar::BUILD does have a next method');
+
+is(Class::MOP::Class->initialize('Baz')->find_next_method_by_name('BUILD'),
+ Class::MOP::Class->initialize('Bar')->get_method('BUILD'),
+ '... Baz->BUILD does have a next method');
+
+is(Class::MOP::Class->initialize('Foo::Bar')->find_next_method_by_name('BUILD'),
+ Class::MOP::Class->initialize('Foo')->get_method('BUILD'),
+ '... Foo::Bar->BUILD does have a next method');
+
+is(Class::MOP::Class->initialize('Foo::Bar::Baz')->find_next_method_by_name('BUILD'),
+ Class::MOP::Class->initialize('Foo')->get_method('BUILD'),
+ '... Foo::Bar::Baz->BUILD does have a next method');
+
is_deeply(
[ sort { $a->{name} cmp $b->{name} } Class::MOP::Class->initialize('Foo')->compute_all_applicable_methods() ],
[
use strict;
use warnings;
-use Test::More tests => 19;
+use Test::More tests => 25;
use Test::Exception;
BEGIN {
is($method->name, '__ANON__', '... our sub name is __ANON__');
is($method->fully_qualified_name, 'main::__ANON__', '... our subs full name is main::__ANON__');
+dies_ok { Class::MOP::Method->wrap } '... cant call this method without some code';
+dies_ok { Class::MOP::Method->wrap([]) } '... cant call this method without some code';
+dies_ok { Class::MOP::Method->wrap(bless {} => 'Fail') } '... cant call this method without some code';
+
+dies_ok { Class::MOP::Method->name } '... cant call this method with a class';
+dies_ok { Class::MOP::Method->package_name } '... cant call this method with a class';
+dies_ok { Class::MOP::Method->fully_qualified_name } '... cant call this method with a class';
+
my $meta = Class::MOP::Method->meta;
isa_ok($meta, 'Class::MOP::Class');