aboutsummaryrefslogtreecommitdiff
path: root/scripts/tests/install-ai.bats
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tests/install-ai.bats')
-rw-r--r--scripts/tests/install-ai.bats28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/tests/install-ai.bats b/scripts/tests/install-ai.bats
index a7eb3c0..9c6040c 100644
--- a/scripts/tests/install-ai.bats
+++ b/scripts/tests/install-ai.bats
@@ -172,3 +172,31 @@ EOF
grep -q "project-owned entry file" "$TEST_HOME/code/fresh/AGENTS.md"
! grep -q "protocols.org" "$TEST_HOME/code/fresh/AGENTS.md"
}
+
+# --- claude-templates/bin/install-ai launcher --------------------------------
+#
+# The launcher is the PATH-facing front door (make install symlinks it into
+# ~/.local/bin/install-ai, same loop as `ai` and `agent-page`). It resolves its
+# own real path through the symlink and execs scripts/install-ai.sh, so the
+# repo-root computation survives being invoked as a symlink from anywhere.
+
+LAUNCHER="$REAL_REPO/claude-templates/bin/install-ai"
+
+@test "install-ai launcher: exists and is executable" {
+ [ -x "$LAUNCHER" ]
+}
+
+@test "install-ai launcher: --help reaches install-ai.sh through the launcher" {
+ run bash "$LAUNCHER" --help
+ [ "$status" -eq 0 ]
+ [[ "$output" == *"Bootstrap .ai/"* ]]
+}
+
+@test "install-ai launcher: works when invoked as a symlink from another dir" {
+ # Reproduces the ~/.local/bin symlink: a link elsewhere must still resolve
+ # the repo root, not break on dirname of the link path.
+ ln -s "$LAUNCHER" "$TEST_HOME/install-ai"
+ run bash "$TEST_HOME/install-ai" --help
+ [ "$status" -eq 0 ]
+ [[ "$output" == *"Bootstrap .ai/"* ]]
+}