Catman...r::Mock(3pm)

πŸ“¦
version 1.2025 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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 is false. 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