use Test::MockObject; use Test::More 'no_plan'; use strict; my $x = Test::MockObject->new( {} ); $x->fake_module('Foo'); $x->fake_new('Foo'); $x->mock( 'isa', sub { warn 'I dont get this warning'; 1 } ); $x->mock( 'bar', sub { 2 } ); is( $x->isa('Foo'), 1 ); is( $x->bar('Foo'), 2 );