Catman...r::Mock(3pm)
π Catman...r::Mock(3pm) β the Perl manual page, but make it cute π
okay bestie, welcome to the Catmandu::Validator::Mock page π this is a Perl module from the User Contributed Perl Documentation, and it is literally the validator that doesn't even look at your data. yes, fr fr. it's giving fake-it-till-you-make-it, and honestly? iconic. π
β¨ NAME β¨
Catmandu::Validator::Mock β validate items based on a flag π
πΈ SYNOPSIS πΈ
use Catmandu::Validator::Mock;
my $validator = Catmandu::Validator::Mock->new(
message => 'item is invalid',
reject => 1,
);
look at that little constructor go π¦ new takes a hash of stuff, you hand it a message and you flip reject on, and boom β you have yourself a validator that is not actually validating anything. main character energy tbh.
π DESCRIPTION π
okay so here's the tea β this Catmandu::Validator exists for testing. it does not actually look at the data to validate β like, it doesn't even peek, it doesn't even glance, no vibe check whatsoever π
instead, it rejects items if reject is set to a true value. that's it. that's the whole personality. and honestly, we respect the commitment π
π§ CONFIGURATION π§
messageβ the error message it hands back for rejected items π like, the little note it leaves when it says no.rejectβ the validator marks all items as invalid as long as this flag is true π default isfalse. so if you don't set it, everybody passes. set it, and everybody's getting rejected. no in-between, no nuance, she's a binary queen β¨
π«Ά SEE ALSO π«Ά
go check out Catmandu::Validator for the inherited methods, the common configuration options, and general usage π¦ that's where the family lives, iykyk.
π heads up bestie: this thing does not look at your data. at all. so don't ship it to prod thinking it's gonna catch anything β it's a testing toy, periodt.
perl v5.40.1 Β· 2026-01-24 β that's the version and date this page was served up, mwah, love that for us ππ bye bestie, go write some tests! πβ¨
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms