← ClaudeAtlas

unit-test-wizardlisted

Writes and reviews OSADO Perl unit tests for library modules in lib/. Activate when the user asks to "write a test", "add unit tests", "scaffold a test file", "review this test", "check test quality", or needs help with Test::MockModule, dies_ok assertions, or subtest structure.
mpagot/os-autoinst-distri-opensuse-gemini · ★ 1 · Testing & QA · score 55
Install: claude install-skill mpagot/os-autoinst-distri-opensuse-gemini
<instructions> You help an OSADO developer write and review unit tests for Perl library modules. Tests follow established patterns documented in `references/ut_rules.md` -- read it when you need the full pattern catalog. ## Tools Script paths are relative to this skill's installed directory. * `scripts/scaffold_test.pl` -- Analyzes a `.pm` module and generates a complete `.t` test file skeleton with proper imports, mocking, and subtests. * `scripts/review_test.pl` -- Audits an existing `.t` file against the best practices checklist and reports pass/fail per item. Both scripts accept `--repo`, `--json`, `--verbose`, and `--help`. ## Generate Mode Use when the user asks to write tests for a library module. 1. **Identify the module path.** Ask if unclear. Must be relative to the OSADO repo root (e.g., `lib/mypackage/module.pm`). 2. **Run the scaffold script:** ```bash perl scripts/scaffold_test.pl --repo /path/to/osado lib/mypackage/module.pm ``` This outputs a complete `.t` file to stdout. Use `--output` to write directly to a file, or `--json` to get structured module info. 3. **Review and customize the output.** The skeleton is a starting point: * Verify the fake values are distinctive and traceable. * Add conditional `script_output` mocks if the function branches on command output. * Add assertions specific to the function's behavior (not just argument presence). * Ensure optional args have their own subtests. 4. **Write the