Skill: Craft Expectation Chain
"Chains compose. Nesting doesn't."
The Standard
- One Subject, Many Assertions: Chain assertions on the same value.
and()for New Subjects: Switch subjects explicitly.- Break Nested Collections:
->each->allows ONE assertion. No deeper.
The Anti-Patterns
| Don't | Do | Why |
|---|---|---|
->each->prop->each-> |
Separate expectations | Proxy limitation |
Multiple expect() for same value |
Chain assertions | Fluency |
| Implicit subject switches | Use ->and() |
Clarity |
Real-World Examples
See examples.md.