A file=<relative/path> block writes its contents to disk before the commands
in the same section run, so a document can show an input file directly instead of
hiding it in a heredoc. Files are scoped to their section: blocks in the same
section share them, and a new section starts from a clean directory.
The json file=config.json block is materialized; the next command reads it by
its relative path.
{"name":"widget","status":"active"}cat config.json | mustmatch like '"status":"active"'Later commands in the same section reuse the same fixture without recreating it.
ready
cat state.txt | mustmatch like "ready"grep ready state.txt | mustmatch like "ready"A section that declares no files runs from the document's own directory, so the
private fixture directory from the previous section is not in scope — its
state.txt is not visible here.
find . -name state.txt -maxdepth 2 | mustmatch not like "state.txt"A file= block can take each_row, rendering its content once per table row so
each row reads its own copy.
| str:name | status | str:label |
|---|---|---|
| alpha | ready | alpha |
| beta | done | beta |
{{name}}={{status}}
cat row.txt | mustmatch like '{{name}}={{status}}'A file= path must be relative and stay under the section directory.
Absolute paths and .. segments are rejected before anything runs, so a
document can never write outside its fixture sandbox.