in reply to Re^9: 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.

Replies are listed 'Best First'.
Re^11: Test::More and is_array
by adrianh (Chancellor) on Jun 17, 2005 at 21:50 UTC
    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.