Bug 257466 - [New port] devel/p5-Mock-MonkeyPatch ver 1.02: Monkey patching with test mocking in mind
Summary: [New port] devel/p5-Mock-MonkeyPatch ver 1.02: Monkey patching with test mock...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Li-Wen Hsu
URL: https://metacpan.org/dist/Mock-Monkey...
Keywords:
Depends on:
Blocks: 257467
  Show dependency treegraph
 
Reported: 2021-07-28 02:00 UTC by Sergei Vyshenski
Modified: 2021-07-28 09:29 UTC (History)
1 user (show)

See Also:


Attachments
"git diff" for new port (2.22 KB, patch)
2021-07-28 02:00 UTC, Sergei Vyshenski
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Vyshenski 2021-07-28 02:00:28 UTC
Created attachment 226749 [details]
"git diff" for new port

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.

WWW: https://metacpan.org/dist/Mock-MonkeyPatch

- This port is needed as a new dependency for existing port 
devel/p5-Workflow

- "portlint -ACN" is happy.
- "portclippy Makefile" is happy.
- Tested with:
13.0-RELEASE-p3
pkg 1.16.3
poudriere 3.3.6
perl 5.32.1
openssl 1.1.1k
ssl=base
- built-in perl tests in a clean poudriere jail say: PASS.
Comment 1 commit-hook freebsd_committer 2021-07-28 09:29:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c0a39d980d0f1f2c72c4c00f6346c08acd949b60

commit c0a39d980d0f1f2c72c4c00f6346c08acd949b60
Author:     Sergei Vyshenski <svysh.fbsd@gmail.com>
AuthorDate: 2021-07-28 09:27:20 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2021-07-28 09:27:20 +0000

    devel/p5-Mock-MonkeyPatch: (NEW) Monkey patching with test mocking in mind

    PR:             257466

 devel/Makefile                            |  1 +
 devel/p5-Mock-MonkeyPatch/Makefile (new)  | 25 +++++++++++++++++++++++++
 devel/p5-Mock-MonkeyPatch/distinfo (new)  |  3 +++
 devel/p5-Mock-MonkeyPatch/pkg-descr (new) | 12 ++++++++++++
 devel/p5-Mock-MonkeyPatch/pkg-plist (new) |  2 ++
 5 files changed, 43 insertions(+)