Skip to content

Commit 0a55652

Browse files
committed
Enable RSpec/DescribedClass cop
1 parent 0789d7a commit 0a55652

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ RSpec/DescribeSymbol:
961961
# Checks that the second argument to top level describe is the tested method
962962
# name.
963963
RSpec/DescribedClass:
964-
Enabled: false
964+
Enabled: true
965965

966966
# Checks for long example.
967967
RSpec/ExampleLength:

doc/development/testing.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ Please consult the [dedicated "Frontend testing" guide](./fe_guide/testing.md).
188188
### General Guidelines
189189

190190
- Use a single, top-level `describe ClassName` block.
191-
- Use `described_class` instead of repeating the class name being described.
191+
- Use `described_class` instead of repeating the class name being described
192+
(_this is enforced by RuboCop_).
192193
- Use `.method` to describe class methods and `#method` to describe instance
193194
methods.
194195
- Use `context` to test branching logic.
@@ -197,7 +198,7 @@ Please consult the [dedicated "Frontend testing" guide](./fe_guide/testing.md).
197198
- Don't `describe` symbols (see [Gotchas](gotchas.md#dont-describe-symbols)).
198199
- Don't assert against the absolute value of a sequence-generated attribute (see [Gotchas](gotchas.md#dont-assert-against-the-absolute-value-of-a-sequence-generated-attribute)).
199200
- Don't supply the `:each` argument to hooks since it's the default.
200-
- Prefer `not_to` to `to_not` (_this is enforced by Rubocop_).
201+
- Prefer `not_to` to `to_not` (_this is enforced by RuboCop_).
201202
- Try to match the ordering of tests to the ordering within the class.
202203
- Try to follow the [Four-Phase Test][four-phase-test] pattern, using newlines
203204
to separate phases.

0 commit comments

Comments
 (0)