Test::Mouse(3pm)
π Test::Mouse(3pm) β the cute little test helper for Mouse π
Okay so bestie, this is the manual page for Test::Mouse, straight out of the User Contributed Perl Documentation section of the perl man pages. It's a Perl module, and it's literally just a grab-bag of test functions for Mouse-specific stuff. Let's get into it πβ¨
πΈ NAME πΈ
Test::Mouse β test functions for Mouse-specific features, no cap π
β¨ SYNOPSIS β¨
Like, here's the whole vibe in code. Copy it exactly, bestie:
use Test::More plan => 1;
use Test::Mouse;
meta_ok($class_or_obj, "... Foo has a ->meta");
does_ok($class_or_obj, $role, "... Foo does the Baz role");
has_attribute_ok($class_or_obj, $attr_name, "... Foo has the 'bar' attribute");
π¦ DESCRIPTION π¦
This module hands you some genuinely useful test functions for classes built on Mouse. π
And listen β it's an experimental first release, so like... comments and suggestions are very welcome? Seriously, the author wants your feedback, don't be shy π«Ά
π EXPORTED FUNCTIONS π
Here's where it gets good. Every single one of these gets exported for you:
meta_ok ($class_or_object)β checks whether a class or an object actually has a metaclass. That's it, that's the whole test. βdoes_ok ($class_or_object, $role, ?$message)β checks whether a class or object does a certain role. It's giving very much the same energy as whatisa_okdoes for theisamethod πhas_attribute_ok($class_or_object, $attr_name, ?$message)β checks whether a class or object has a certain attribute. Basically the attribute version of whatcan_okdoes for methods β¨with_immutable { CODE } @class_namesβ okay this one's fun: it runsCODEtwice (and heads up,CODE*which should contain normal tests), and it makes each class in@class_namesimmutable between the two runs. Like a before/after glow-up for your classes π
Fr fr, note that odd *which should contain normal tests) in there β that's how it's written in the original, so we're keeping it exactly as-is. Not me fixing it π
π₯ SEE ALSO π₯
Go read these too, iykyk:
MouseTest::MooseTest::More
So yeah β that's the whole page, bestie. This one came from perl v5.42.2 and it's dated 2026-04-21, filed under the User Contributed Perl Documentation section, and the footer says Test::Mouse(3pm) in case you forgot where you were π Happy testing, mwah ππ¦β
π¦ where this page comes from
- alpine 3.24: perl-mouse-doc 2.6.2-r0 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms