X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=moose-class%2Fexercises%2Ft%2Flib%2FMooseClass%2FTests.pm;h=dd0b2ef81e470d90f7ae004b1927362beb08b194;hb=d047d1d4619aa3877580a69f5cdc02184b04c263;hp=0015192a581c156722ed079476e4e4ef450cb405;hpb=216ed9cb8b80e068bd29665393a341edc5b4fb9a;p=gitmo%2Fmoose-presentations.git diff --git a/moose-class/exercises/t/lib/MooseClass/Tests.pm b/moose-class/exercises/t/lib/MooseClass/Tests.pm index 0015192..dd0b2ef 100644 --- a/moose-class/exercises/t/lib/MooseClass/Tests.pm +++ b/moose-class/exercises/t/lib/MooseClass/Tests.pm @@ -376,7 +376,12 @@ sub person01 { is( $person->full_name, 'Bilbo Baggins', 'full_name() is correctly implemented' ); - $person = Person->new( [ qw( Lisa Smith ) ] ); + $person = eval { Person->new( [ qw( Lisa Smith ) ] ) }; + ok( !$@, 'Person->new() can accept an array reference as an argument' ) + or BAIL_OUT( + 'You must implement Person->BUILDARGS in order to continue these tests' + ); + is( $person->first_name, 'Lisa', 'set first_name from two-arg arrayref' ); is( $person->last_name, 'Smith', 'set last_name from two-arg arrayref' );