background image
<< isa_ok() | use_ok() >>
<< isa_ok() | use_ok() >>
A test for $obj->can($some_method)
ok( $obj->can('foo'), 'foo() method inherited' );
Simple but useful test can be like:
# Does the Foo class have these methods?
can_ok( 'Foo', qw(this that whatever wibble) );
Might seem silly, but can catch stupid mistakes like forgetting a "=cut"
Takes an object or a class.
Also useful for checking your functions are exported
use Text::Soundex;
can_ok(__PACKAGE__, 'soundex');