Commit bfc3f294 authored by Mike Jang's avatar Mike Jang

Merge branch 'subject-named-reference' into 'master'

Docs: Clarify definition of subject

See merge request gitlab-org/gitlab!42445
parents 7578f364 9dc4cf88
...@@ -448,7 +448,9 @@ so we need to set some guidelines for their use going forward: ...@@ -448,7 +448,9 @@ so we need to set some guidelines for their use going forward:
- `let!` variables should be used only in case if strict evaluation with defined - `let!` variables should be used only in case if strict evaluation with defined
order is required, otherwise `let` will suffice. Remember that `let` is lazy and won't order is required, otherwise `let` will suffice. Remember that `let` is lazy and won't
be evaluated until it is referenced. be evaluated until it is referenced.
- Use named `subject(:name)` over un-named `subject` in examples, as this gives the subject a contextual name. - Avoid referencing `subject` in examples. Use a named subject `subject(:name)`, or a `let` variable instead, so
the variable has a contextual name.
- If the `subject` is never referenced inside examples, then it's acceptable to define the `subject` without a name.
### Common test setup ### Common test setup
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment