background image
<< like() | can_ok() >>
<< like() | can_ok() >>
We've been doing this a lot.
ok( defined $ical, "new(ical => '$ical_str')" );
ok( $ical->isa('Date::ICal'), " and it's the right class" );
You do this so much in OO code, there's a special function.
isa_ok( $ical, 'Date::ICal' );
It works on references, too.
isa_ok( $foo, 'ARRAY' ); # is $foo an array ref?
It also has nice diagnostics.
not ok 1 - The object isa Date::ICal
# Failed test (- at line 2)
# The object isn't a 'Date::ICal' it's a 'ARRAY'