On Saturday 06 July 2002 18:41, Michael G Schwern wrote:
> The purpose of isa_ok() is two fold:
> Check that a scalar contains an object
> Check that object is of the right class
> and it only exists because it's a very common test and you have to do the
> above in several steps to get good diagnostics:
> So I'm not convinced. Why did you find it useful?
I thought it corresponded more closely to UNIVERSAL::isa(). Your rationale
makes sense. The code being tested was something like:
use base 'Parent::Class';
My test was:
use_ok( 'Child::Class' );
isa_ok( 'Child::Class', 'Parent::Class' );
I could just as easily check @Child::Class::ISA or use UNIVERSAL::isa().
> Worse, it adds an ambiguity into isa_ok() with the small possiblity that
> $obj might contain a class string and cause a false positive.
I'm not convinced my patch allows that, but I can see where this patch doesn't
really fit. Thanks!
-- c