Okay, but without using Test::More::isa_ok(), the following script still
fails the third and fourth test:
use Test::More tests => 4;
use Test::MockObject::Extends;
# fake that Foo is loaded
$INC{"Foo.pm"} = "./Foo.pm";
# create object
$obj = bless {}, "Foo";
# test if the object is a reference to a hash
ok($obj->isa("HASH"), "The object isa HASH");
ok(UNIVERSAL::isa($obj, "HASH"),
"...also if UNIVERSAL::isa() is called as a function");
# wrap in mock object
Test::MockObject::Extends->new($obj);
# test if the mock object is still a reference to a hash
ok($obj->isa("HASH"), "The extended object isa HASH");
ok(UNIVERSAL::isa($obj, "HASH"),
"...also if UNIVERSAL::isa() is called as a function");
Of course, I could use Scalar::Util::reftype(), but why import an extra
module, if UNIVERSAL::isa() can tell me the same? The point is that if I
extend my object with Test::MockObject::Extends, the behaviour of my
object's isa() method changes.