Test::...emonize(3pm)

πŸ“¦
version 0.22 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Test::MooseX::Daemonize β€” the Test::...emonize(3pm) page, but make it cute πŸ’–

okay so bestie, this is a page from the User Contributed Perl Documentation collection, and it's literally the whole manual for Test::MooseX::Daemonize. It's short, it's sweet, it's giving helpful little test helper, and we're gonna go through <em>every single bit</em> of it together. No skipping. Periodt. πŸ’…


✨ NAME ✨

Test::MooseX::Daemonize β€” a tool to help test MooseX::Daemonize applications. That's it, that's the whole vibe. It's the friend that holds your hand while you test your daemons. 🫢


🌸 VERSION 🌸

version <code>0.22</code> β€” that's the one we're on, bestie. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

Here's the little taste test, copied <em>exactly</em> so you can run it and feel iconic:

use File::Spec::Functions;
use File::Temp qw(tempdir);

my $dir = tempdir( CLEANUP => 1 );

## Try to make sure we are in the test directory

my $file = catfile( $dir, "im_alive" );
my $daemon = FileMaker->new( pidbase => $dir, filename => $file );

daemonize_ok( $daemon, 'child forked okay' );
ok( -e $file, "$file exists" );

Not me reading this and being like "oh we're forking a child and checking a file exists, slay." Yes. That is exactly what's happening. πŸ’€


πŸ’œ DESCRIPTION πŸ’œ

So, what does this module even do? It hands you some basic <code>Test::Builder</code>-compatible test methods β€” you know, the kind that slot right into your test suite without drama β€” for when you're writing tests for your <code>MooseX::Daemonize</code>-based modules. That's the whole point. It's a helper. It's a bestie. It's not trying to be anything else. 🧚


πŸŽ€ EXPORTED FUNCTIONS πŸŽ€

These are the little functions it gives you. Two of them. Both adorable. Both important. πŸ’–

  • daemonize_ok ( $daemon, ?$msg ) β€” This one tries to daemonize your $daemon, and it goes ok on success and not ok on failure. The ?$msg is the optional message you can hand it, because every test deserves a little caption. πŸ’…
  • check_test_output ( $daemon ) β€” okay so this one is expected to be used with a $daemon that does the <code>Test::MooseX::Daemonize::Testable</code> role (that role is included in this package, and the original literally says to <em>see the source for more info</em>). What it does: it collects the test output from your daemon and applies it in the parent process by mucking around with Test::Builder stuff β€” and again, the original says <em>read the source for more info</em>. And then, iconic behaviour honestly: "If we get time we will document this more thoroughly." 😭 We love a candid queen. The docs are vibes-based and the source is the truth. 🫢

🌈 SEE ALSO 🌈

  • MooseX::Daemonize β€” the main character this whole module exists to support. πŸ‘‘

πŸ“ SUPPORT πŸ“

Need help? Got beef with a bug? The original lays out the whole support situation, so here it is:


πŸ‘‘ AUTHORS πŸ‘‘

The legends who made this happen:

  1. Stevan Little <stevan.little@iinteractive.com>
  2. Chris Prather <chris@prather.org>

Two icons. One tiny testing module. ✨


This software is copyright (c) 2007 by Chris Prather.

And the legal tea, verbatim in meaning: this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. So go forth and remix, bestie. 🌸


okay and finally, the cute lil sign-off: this whole page is from perl v5.30.0, dated 2019-12-22. πŸŽ€ That's the tea, that's the page, go write some tests and slay. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from