package A::Class; sub some_method { my ($self, $object) = @_; die "Object is not what I expect" unless UNIVERSAL::isa( $object, 'Some::Class' ); $object->some_other_method(); $object->some_method_or_other(); } #### use Test::More 'no_plan'; use Test::MockObject; my $mock = Test::MockObject->new(); use_ok( 'A::Class' ); my $a = A::Class->new(); isa_ok( $a, 'A::Class' ); $mock->set_true( 'some_other_method' ) ->set_true( 'some_method_or_other' ); $a->some_method( $mock );