use Test::Automock; my $mock = Test::Automock->('Some::Difficult::Module'); $mock->add( fetch_my_slippers => sub { 1 } ); # adds this method can_ok $object, 'stuff'; ok $object->stuff, '... and calling it should succeed'; my @expected = ( fribble => [ $mock, $object ], woobie => [ $mock ], ); is_deeply $mock->methods_called, \@expected, "... with Some::Difficult::Methods doing their thing"; $mock->reset;