| April 14, 2012 | 82% of Perl Testing | Back Next |
new(): 'string' element undefined
method will 'die'; capture error message
eval {
$self = Alpha->new( {
string => undef,
} );
};
like($@, qr/Alpha::new\(\) needs 'string' argument/,
"Alpha->new(): got expected error message when 'string' was not defined");
| Home Last TOC | Copyright © 2012 James E Keenan | Back Next |