X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F010_basics%2F018_methods.t;h=aa3bb4b7b3e2b678c59410e739c5ac420c47d11a;hb=0a13237516ec8e10f2568908e422b80850bc5d02;hp=ce202ccd2d2efcf2a27a726233f4fbe134ea152c;hpb=96245b5a81c1e26b52133a282b31759d162ee635;p=gitmo%2FMoose.git diff --git a/t/010_basics/018_methods.t b/t/010_basics/018_methods.t index ce202cc..aa3bb4b 100644 --- a/t/010_basics/018_methods.t +++ b/t/010_basics/018_methods.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 4; +use Test::More; my $test1 = Moose::Meta::Class->create_anon_class; @@ -11,14 +11,18 @@ $test1->add_method( 'foo1', sub { } ); my $t1 = $test1->new_object; my $t1_am = $t1->meta->get_method('foo1')->associated_metaclass; + ok( $t1_am, 'associated_metaclass is defined' ); + isa_ok( $t1_am, 'Moose::Meta::Class', 'associated_metaclass is correct class' ); -{ +like( $t1_am->name(), qr/::__ANON__::/, + 'associated_metaclass->name looks like an anonymous class' ); +{ package Test2; use Moose; @@ -28,9 +32,15 @@ isa_ok( my $t2 = Test2->new; my $t2_am = $t2->meta->get_method('foo2')->associated_metaclass; + ok( $t2_am, 'associated_metaclass is defined' ); isa_ok( $t2_am, 'Moose::Meta::Class', 'associated_metaclass is correct class' ); + +is( $t2_am->name(), 'Test2', + 'associated_metaclass->name is Test2' ); + +done_testing;