FreeBSD.software
Home/devel/p5-Mock-MonkeyPatch

p5-Mock-MonkeyPatch

1.03devel

Monkey patching with test mocking in mind

Mocking is a common tool, especially for testing. By strategically replacing a subroutine, one can isolate segments (units) of code to test individually. When this is done it is important to know that the mocked sub was actually called and with what arguments it was called. Mock::MonkeyPatch injects a subroutine in the place of an existing one. It returns an object by which you can revisit the manner in which the mocked subroutine was called. Further when the object goes out of scope (or when the "restore" method is called) the original subroutine is replaced.

$pkg install p5-Mock-MonkeyPatch
metacpan.org/dist/Mock-MonkeyPatch
Origin
devel/p5-Mock-MonkeyPatch
Size
52.2KiB
License
ART10, GPLv1+
Maintainer
svysh.fbsd@gmail.com
Dependencies
2 packages
Required by
0 packages

Dependencies (2)