aboutsummaryrefslogtreecommitdiff
path: root/scripts/tests/session-title-hook.bats
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tests/session-title-hook.bats')
-rw-r--r--scripts/tests/session-title-hook.bats10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/tests/session-title-hook.bats b/scripts/tests/session-title-hook.bats
index 60b633d..5ce8b6a 100644
--- a/scripts/tests/session-title-hook.bats
+++ b/scripts/tests/session-title-hook.bats
@@ -1,6 +1,6 @@
#!/usr/bin/env bats
# hooks/session-title.sh — SessionStart hook that titles the session
-# "<host> <project>" (uname -n + git-toplevel basename, cwd basename outside
+# "<host>-<project>" (uname -n + git-toplevel basename, cwd basename outside
# a repo) so remote sessions are identifiable on web/mobile. It only sets a
# title when the session doesn't have one yet: a /rename or an earlier run
# must not be clobbered on resume.
@@ -25,13 +25,13 @@ run_hook() {
fi
}
-@test "titles host + repo basename inside a git repo" {
+@test "titles host-repo basename inside a git repo" {
git -C "$TMPDIR_T" init -q -b main
mkdir -p "$TMPDIR_T/sub/dir"
run run_hook "$TMPDIR_T"
[ "$status" -eq 0 ]
title=$(echo "$output" | jq -r '.hookSpecificOutput.sessionTitle')
- [ "$title" = "$HOST $(basename "$TMPDIR_T")" ]
+ [ "$title" = "$HOST-$(basename "$TMPDIR_T")" ]
}
@test "uses the repo toplevel basename from a subdirectory" {
@@ -40,7 +40,7 @@ run_hook() {
run run_hook "$TMPDIR_T/sub/dir"
[ "$status" -eq 0 ]
title=$(echo "$output" | jq -r '.hookSpecificOutput.sessionTitle')
- [ "$title" = "$HOST $(basename "$TMPDIR_T")" ]
+ [ "$title" = "$HOST-$(basename "$TMPDIR_T")" ]
}
@test "falls back to cwd basename outside a git repo" {
@@ -48,7 +48,7 @@ run_hook() {
run run_hook "$TMPDIR_T/chime"
[ "$status" -eq 0 ]
title=$(echo "$output" | jq -r '.hookSpecificOutput.sessionTitle')
- [ "$title" = "$HOST chime" ]
+ [ "$title" = "$HOST-chime" ]
}
@test "emits valid SessionStart hookSpecificOutput" {