#!/usr/bin/env bash # # Tests for claude-launcher-profiles (profile logic + installer). # # Design: # - A stub `claude` captures the ANTHROPIC_* env vars the launcher exports, # so we can assert on them without a real Claude Code or network. # - launch_profile calls `exec claude`, so every invocation runs inside a # subshell — the exec then only ends the subshell, not the test runner. # - Installer tests run with HOME pointed at a temp dir and a throwaway repo # clone, so they never touch the real repo working tree. # # Run: bash tests/test_profiles.sh # or: make test set -u REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" TESTS_RUN=0 TESTS_FAIL=0 FAILED_CASES=() # ---- assert helpers -------------------------------------------------------- assert_eq() { # assert_eq