On Sun, 16 Dec 2001 19:30:18 -0700, Benjamin Goldberg wrote:
> I think that if "all" we know about the returned type is that it is supposed
> to provide some specific interface, it would be more robust to test that the
> returned thing actually *does* provide the interface.
Agreed. You have my permission not to use isa_ok() in that case. :)
It did come in handy for the ExtUtils::Installed test, though. The constructor
returns an object with a Perl member, which itself has a packlist member that's
supposed to be an ExtUtils::Packlist object. This gives me the nice and easy
test:
isa_ok( $realei->{Perl}{packlist}, 'ExtUtils::Packlist' );
If someone subclasses ExtUtils::Packlist and modifies ExtUtils::Installed to
use the subclass, the test won't break. If they write something with a similar
interface but don't derive from ExtUtils::Packlist, the test will break.
I'm not worried about that. With a change that large, the test will probably
need to be modified anyway.
-- c