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