| April 26, 2007 | Component-Focused Testing | Back Next |
Most subroutines relied on the same data
Make the data into an object, call methods on it
$self = Parrot::Pmc2c::Utils->new( {
include => \@include,
opt => \%opt,
args => \@args,
} );
Then test the methods
eval {
$self = Parrot::Pmc2c::Utils->new( {
opt => \%opt,
args => [ @args ],
} );
};
like($@,
qr/Must have key 'include': ref to array of directories/,
"Constructor correctly failed due to lack of 'include' key");
| Home Last TOC | Copyright © 2007 James E Keenan | Back Next |