Test::...utable(3pm)

πŸ’– Test::Skip::UnlessExistsExecutable πŸ’–

okay so bestie, welcome to the Test::Skip::UnlessExistsExecutable page from the User Contributed Perl Documentation manual set πŸŽ€ β€” yes the header up top says Test::...utable(3pm) because even the man page title got the abbreviation treatment, but the full name is right here and it's a whole mouthful, we love that for it.


✨ NAME ✨

Test::Skip::UnlessExistsExecutable β€” skips tests unless executable exists πŸ¦‹


🌸 SYNOPSIS 🌸

use Test::More tests => 1;
use Test::Skip::UnlessExistsExecutable qw(
    /usr/bin/rsync
    perl
);
use_ok 'Mouse';

# or

use Test::More tests => 1;
use Test::Skip::UnlessExistsExecutable;

skip_all_unless_exists '/bin/sh';
skip_all_unless_exists 'perl';
ok 1;

two whole vibes, pick your fighter πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

Test::Skip::UnlessExistsExecutable checks if an executable exist and skips the test if it does not. lowkey the entire point is that you should never have to hand-write this kind of boilerplate code, because writing it is giving copy-paste energy and nobody has time:

Test::More;
BEGIN {
    do_i_have_all_my_optional_deps() ? plan skip_all : plan tests => 42
}

no cap, that block? not the move. 🫢


🧚 INTERFACE 🧚

Both Test::Skip::UnlessExistsExecutable import method and test_exists_executable method take the name of a program or the file path of executable. It checks if the program exists and is executable. ✨

fr fr, that's the whole interface. either you import it with a list, or you call the method yourself β€” either way you're handing it a program name or a full path to an executable, and it does the vibe check: exists? executable? slay. doesn't? we skip. πŸ’€

🌈 SOURCE AVAILABILITY 🌈

This source is in Github:

http://github.com/dann/p5-test-skip-unlessexistsexecutable

go look at it, it's iconic πŸ”₯


πŸ’œ AUTHOR πŸ’œ

dann <techmemo@gmail.com>


🌟 SEE ALSO 🌟

bestie… this section is literally empty. nothing here. a beautiful blank canvas. we respect it πŸŽ€


πŸ“ LICENSE πŸ“

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, periodt πŸ’– stay slaying those optional dependency checks, and remember: your tests should skip gracefully, not explode dramatically.

this was perl v5.36.0, dated 2023-02-02, from the User Contributed Perl Documentation β€” mwah, thanks for reading bestie πŸ¦‹βœ¨

πŸ“¦ where this page comes from