I need to make fun of the built-in type operators unlinkand renameas part of a test suite. I can't get this to work usingTest::MockObject
>> my $mock = Test::MockObject->new();
>> $mock->mock('unlink', sub { print "Mocked!\n"; });
>> unlink "foo";
0
Is it possible to mock such built-in functions?
source
share