X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F003_methods.t;h=6b39b0ac1d228d123b5c5b78280e65fe29d534ce;hb=729fd9ba69ec6f9150504b4c24c46365fba7cdf4;hp=ebc54948676fffcfe666b3b624408a1b8376dc1c;hpb=2621d59fd7886110273773603bef310765e18b93;p=gitmo%2FClass-MOP.git diff --git a/t/003_methods.t b/t/003_methods.t index ebc5494..6b39b0a 100644 --- a/t/003_methods.t +++ b/t/003_methods.t @@ -170,15 +170,9 @@ is_deeply( '... got the right method list for Foo'); is_deeply( - [ sort { $a->{name} cmp $b->{name} } $Foo->compute_all_applicable_methods() ], + [ sort { $a->name cmp $b->name } $Foo->get_all_methods() ], [ - map { - { - name => $_, - class => 'Foo', - code => $Foo->get_method($_) - } - } qw( + map { $Foo->get_method($_) } qw( FOO_CONSTANT baaz bang @@ -205,13 +199,13 @@ is_deeply( # ... test our class creator my $Bar = Class::MOP::Class->create( - 'Bar' => ( - superclasses => [ 'Foo' ], - methods => { - foo => sub { 'Bar::foo' }, - bar => sub { 'Bar::bar' }, - } - )); + package => 'Bar', + superclasses => [ 'Foo' ], + methods => { + foo => sub { 'Bar::foo' }, + bar => sub { 'Bar::bar' }, + } +); isa_ok($Bar, 'Class::MOP::Class'); ok($Bar->has_method('foo'), '... Bar->has_method(foo)'); @@ -233,50 +227,20 @@ is_deeply( '... got the right method list for Bar'); is_deeply( - [ sort { $a->{name} cmp $b->{name} } $Bar->compute_all_applicable_methods() ], + [ sort { $a->name cmp $b->name } $Bar->get_all_methods() ], [ - { - name => 'FOO_CONSTANT', - class => 'Foo', - code => $Foo->get_method('FOO_CONSTANT') - }, - { - name => 'baaz', - class => 'Foo', - code => $Foo->get_method('baaz') - }, - { - name => 'bang', - class => 'Foo', - code => $Foo->get_method('bang') - }, - { - name => 'bar', - class => 'Bar', - code => $Bar->get_method('bar') - }, - (map { - { - name => $_, - class => 'Foo', - code => $Foo->get_method($_) - } - } qw( + $Foo->get_method('FOO_CONSTANT'), + $Foo->get_method('baaz'), + $Foo->get_method('bang'), + $Bar->get_method('bar'), + (map { $Foo->get_method($_) } qw( baz blah evaled_foo floob )), - { - name => 'foo', - class => 'Bar', - code => $Bar->get_method('foo') - }, - { - name => 'meta', - class => 'Bar', - code => $Bar->get_method('meta') - } + $Bar->get_method('foo'), + $Bar->get_method('meta'), ], '... got the right list of applicable methods for Bar');