← ClaudeAtlas

nullableslisted

Specifies behavior without mocks using Nullables. Use when writing specifications, especially specifying code with external I/O (HTTP, files, databases, clocks, random numbers), designing infrastructure wrappers or replacing mocking libraries.
jonfazzaro/skills · ★ 0 · Data & Documents · score 62
Install: claude install-skill jonfazzaro/skills
## Context marker 🔌 When the skill activates, begin the first commentary update with `🔌` and a concise `Using nullables ...` announcement. Do not repeat the marker on later updates unless another skill activates. # Nullables: Specifying Without Mocks ## The Problem External I/O is slow and flaky. Specifications hitting real databases, APIs, or file systems run slow and fail randomly. We want specifications that run in milliseconds and never fail due to network issues. Mocking libraries solve speed but introduce a new problem: they couple specifications to implementation by verifying specific method calls. Specification code using mocking libraries is brittle—it breaks when code is refactored, even when behavior is unchanged. ## The Solution Nullables are production code with an "off switch" for infrastructure—not test doubles, but real code you can ship (dry-run modes, cache warming, offline operation). They enable **narrow, sociable, state-based specifications**: - **Narrow**: Each expectation focuses on one class/module, not broad end-to-end flows - **Sociable**: Specifications use real dependencies—only infrastructure I/O is neutralized. (Contrast with "solitary" tests that mock everything, isolating the class under test.) - **State-based**: Assert on outputs and state, not on which methods were called ## When to Use **Use Nullables for:** - Code that talks to external systems (HTTP, files, databases, clocks, random) - Third-party libraries you don't control -