diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-25 01:30:28 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-25 01:30:28 -0500 |
| commit | 20de0eca58802bc778b5a0103c6b910762b447a4 (patch) | |
| tree | 72ec020c5fd2bc105f7ccd29bd81b9c695bdfe82 /claude-rules/testing.md | |
| parent | e5b54c24afdd569765b215732884bd0a8f2758a9 (diff) | |
| download | rulesets-20de0eca58802bc778b5a0103c6b910762b447a4.tar.gz rulesets-20de0eca58802bc778b5a0103c6b910762b447a4.zip | |
docs(commits,testing): add merge strategy + multi-pass gate + time-mocking safety
commits.md gets two additions. A new "## Merge Strategy" section makes
squash-merge the default for feature branches and requires explicit
confirmation of the merge approach before pushing or merging. A new
"Multi-pass gate" paragraph in Review and Publish requires every
humanizer-flow pass to run and be named when declaring done, so
silent skips become defects.
testing.md gets a new bullet under "### Determinism": time/clock-mocking
helpers must not recurse against the primitive they're mocking, and must
not let-bind over a defvar — the binding shadows only inside the test
scope, so production code reading the symbol still gets the original
value (silent test miss).
Diffstat (limited to 'claude-rules/testing.md')
| -rw-r--r-- | claude-rules/testing.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/claude-rules/testing.md b/claude-rules/testing.md index 02c6ce0..a6bc1df 100644 --- a/claude-rules/testing.md +++ b/claude-rules/testing.md @@ -158,6 +158,13 @@ the specific case choice. - Never hardcode dates or times — generate them relative to `now()` - No reliance on test execution order - No flaky network calls in unit tests +- Time/clock-mocking helpers must not call the primitives they're + mocking (infinite recursion), and must not `let`-bind over a + `defvar` or other globally-defined symbol (the binding shadows the + global only inside the test scope, so production code that reads the + symbol gets the original value, not the mock — silent test miss). + Mock by redefining at the symbol's definition site or via the + language's first-class mocking primitive. ### Performance - Unit tests: <100ms each |
