aboutsummaryrefslogtreecommitdiff
path: root/.ai/scripts/tests/test_inbox_send.py
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-28 12:24:59 -0400
committerCraig Jennings <c@cjennings.net>2026-06-28 12:24:59 -0400
commit9753d03a33aed124cf23573a09dec36695815dde (patch)
treec3f488ba7a5b8e6144bd9e42753ffb214fff4bd9 /.ai/scripts/tests/test_inbox_send.py
parent92dfc355d2292c6d6c17a51cf2f83b8ba033596a (diff)
downloadrulesets-9753d03a33aed124cf23573a09dec36695815dde.tar.gz
rulesets-9753d03a33aed124cf23573a09dec36695815dde.zip
feat(inbox-send): resolve dot-stripped project names
.emacs.d resolves as emacsd and .dotfiles as dotfiles, in both inbox-send and the launch trigger. An exact basename match still wins, and --list shows the stripped name. triggers.md documents the same resolution so the spoken name is consistent across both.
Diffstat (limited to '.ai/scripts/tests/test_inbox_send.py')
-rw-r--r--.ai/scripts/tests/test_inbox_send.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/.ai/scripts/tests/test_inbox_send.py b/.ai/scripts/tests/test_inbox_send.py
index a0094dc..cb60e63 100644
--- a/.ai/scripts/tests/test_inbox_send.py
+++ b/.ai/scripts/tests/test_inbox_send.py
@@ -97,6 +97,52 @@ class TestInboxSendDiscovery:
result = run_script(["--list"], roots=[tmp_path / "does-not-exist"])
assert result.returncode == 0
+ def test_inbox_send_list_displays_dot_stripped_name(self, project_root, run_script, tmp_path):
+ """Dotted project basenames display dot-stripped (.emacs.d → emacsd)."""
+ project_root(".emacs.d")
+ result = run_script(["--list"], roots=[tmp_path / "projects"])
+ assert "emacsd" in result.stdout
+
+
+class TestInboxSendDotAlias:
+ """A dotted project basename resolves both verbatim and dot-stripped."""
+
+ def test_resolves_by_dot_stripped_alias(self, project_root, run_script, tmp_path):
+ """'emacsd' delivers to the .emacs.d project."""
+ project_root(".emacs.d")
+ cwd = project_root("source")
+ run_script(
+ ["emacsd", "--text", "hi"],
+ cwd=cwd, roots=[tmp_path / "projects"],
+ )
+ files = list((tmp_path / "projects" / ".emacs.d" / "inbox").iterdir())
+ assert len(files) == 1
+
+ def test_resolves_by_exact_dotted_name_still(self, project_root, run_script, tmp_path):
+ """Backward-compat: the verbatim '.emacs.d' target still resolves."""
+ project_root(".emacs.d")
+ cwd = project_root("source")
+ run_script(
+ [".emacs.d", "--text", "hi"],
+ cwd=cwd, roots=[tmp_path / "projects"],
+ )
+ files = list((tmp_path / "projects" / ".emacs.d" / "inbox").iterdir())
+ assert len(files) == 1
+
+ def test_exact_match_wins_over_alias(self, project_root, run_script, tmp_path):
+ """An exact basename match is preferred over a dot-stripped collision."""
+ project_root("emacsd") # exact
+ project_root(".emacs.d") # would also normalize to 'emacsd'
+ cwd = project_root("source")
+ run_script(
+ ["emacsd", "--text", "hi"],
+ cwd=cwd, roots=[tmp_path / "projects"],
+ )
+ exact = list((tmp_path / "projects" / "emacsd" / "inbox").iterdir())
+ dotted = list((tmp_path / "projects" / ".emacs.d" / "inbox").iterdir())
+ assert len(exact) == 1
+ assert dotted == []
+
# ----------------------------------------------------------------------
# Slug derivation from text and from filenames