or download this
use strict;
use warnings;
...
throws_ok {My::Base->new()} qr/Attribute \(attr\) is required/, q/inhe
+rited requires 'attr' at construction/;
my $inh = new_ok('My::Inherited' => [attr => 'constructor value']);
cmp_ok($inh->attr, 'eq', "The value of attr is 'constructor value'", '
+inherited is correct');