Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions docs/README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,15 @@ used for its modifiers:
* `// TESTRESPONSE[skip:reason]`: Skip the assertions specified by this
response.
* `// TESTSETUP`: Marks this snippet as the "setup" for all other snippets in
this file. This is a somewhat natural way of structuring documentation. You
say "this is the data we use to explain this feature" then you add the
snippet that you mark `// TESTSETUP` and then every snippet will turn into
a test that runs the setup snippet first. See the "painless" docs for a file
that puts this to good use. This is fairly similar to `// TEST[setup:name]`
but rather than the setup defined in `docs/build.gradle` the setup is defined
right in the documentation file. In general, we should prefer `// TESTSETUP`
over `// TEST[setup:name]` because it makes it more clear what steps have to
be taken before the examples will work. Tip: `// TESTSETUP` can only be used
on the first snippet of a document.
this file. In order to enhance clarity and simplify understanding for readers,
a straightforward approach involves marking the first snippet in the documentation file with the
`// TESTSETUP` marker. By doing so, it clearly indicates that this particular snippet serves as the setup
or preparation step for all subsequent snippets in the file.
This helps in explaining the necessary steps that need to be executed before running the examples.
Unlike the alternative convention `// TEST[setup:name]`, which relies on a setup defined in a separate file,
this convention brings the setup directly into the documentation file, making it more self-contained and reducing ambiguity.
By adopting this convention, users can easily identify and follow the correct sequence
of steps to ensure that the examples provided in the documentation work as intended.
* `// TEARDOWN`: Ends and cleans up a test series started with `// TESTSETUP` or
`// TEST[setup:name]`. You can use `// TEARDOWN` to set up multiple tests in
the same file.
Expand Down
Loading