in reply to Re^10: Test::More and is_array
in thread Test::More and is_array
i'm being ... overly paranoid because of the huge changes to the underlying database structure.
Fair enough, but to my eyes your proposed tests:
my $list = $object->foundation_list; ok( ref( $list ) eq 'ARRAY', 'returned a list' ); ok( scalar( @$list ), 'returned a populated list' ); ok( ref( $list->[0] ) eq 'HASH', 'first element is a hashref ...' );
are less paranoid than the more concrete test:
is_deeply( $object->foundation_list, [ { ... whatever ... } ] );
It does all the type checking and makes sure it's been populated with the correct values.
|
|---|