Setup hook tests

From projectbluefin/bluefin · View interactive version

Setup hook tests is an AI agent skill from the GitHub repository projectbluefin/bluefin. Describes the Bats sandbox layout, path patching, and command stubbing used to test setup hooks in tests/unit. Use when adding or changing coverage for a system_files setup hook.

How to use this skill

Skill file

Setup-hook tests

Procedure

  1. Append to the existing test file for the hook.
  2. Create a unique sandbox under tests/unit/.bats-sandbox/.
  3. Patch absolute system paths before running the hook.
  4. Stub commands through a test-local stub-bin directory.
  5. Assert the concrete side effect, not only exit status.

Run:

bats tests/unit/
pre-commit run --all-files

Red flags

When to Use

Use for Bats coverage for setup hooks.

When NOT to Use

Do not use for Non-hook build scripts or full image validation.

Core Process

Sandbox the hook, patch absolute paths, assert concrete side effects.

Common Rationalizations

Red Flags

Verification

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.