standard-rspec 0.2.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/base.yml +439 -153
- data/lib/standard/rspec/plugin.rb +4 -36
- data/lib/standard/rspec/version.rb +1 -1
- data/standard-rspec.gemspec +5 -3
- metadata +39 -12
- data/lib/standard/rspec/load_rubocop_rspec_without_the_monkey_patch.rb +0 -77
data/config/base.yml
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
RSpec:
|
|
3
3
|
Enabled: true
|
|
4
|
+
StyleGuideBaseURL: https://rspec.rubystyle.guide
|
|
5
|
+
DocumentationBaseURL: https://docs.rubocop.org/rubocop-rspec
|
|
4
6
|
Include: &1
|
|
5
7
|
- "**/*_spec.rb"
|
|
6
8
|
- "**/spec/**/*"
|
|
@@ -10,8 +12,6 @@ RSpec:
|
|
|
10
12
|
- Expectations
|
|
11
13
|
- Helpers
|
|
12
14
|
- Hooks
|
|
13
|
-
- HookScopes
|
|
14
|
-
- Runners
|
|
15
15
|
- Subjects
|
|
16
16
|
ExampleGroups:
|
|
17
17
|
inherit_mode:
|
|
@@ -60,9 +60,14 @@ RSpec:
|
|
|
60
60
|
Pending:
|
|
61
61
|
- pending
|
|
62
62
|
Expectations:
|
|
63
|
+
- are_expected
|
|
63
64
|
- expect
|
|
64
|
-
- is_expected
|
|
65
65
|
- expect_any_instance_of
|
|
66
|
+
- is_expected
|
|
67
|
+
- should
|
|
68
|
+
- should_not
|
|
69
|
+
- should_not_receive
|
|
70
|
+
- should_receive
|
|
66
71
|
Helpers:
|
|
67
72
|
- let
|
|
68
73
|
- let!
|
|
@@ -74,12 +79,6 @@ RSpec:
|
|
|
74
79
|
- prepend_after
|
|
75
80
|
- after
|
|
76
81
|
- append_after
|
|
77
|
-
HookScopes:
|
|
78
|
-
- each
|
|
79
|
-
- example
|
|
80
|
-
- context
|
|
81
|
-
- all
|
|
82
|
-
- suite
|
|
83
82
|
Includes:
|
|
84
83
|
inherit_mode:
|
|
85
84
|
merge:
|
|
@@ -91,10 +90,6 @@ RSpec:
|
|
|
91
90
|
- include_examples
|
|
92
91
|
Context:
|
|
93
92
|
- include_context
|
|
94
|
-
Runners:
|
|
95
|
-
- to
|
|
96
|
-
- to_not
|
|
97
|
-
- not_to
|
|
98
93
|
SharedGroups:
|
|
99
94
|
inherit_mode:
|
|
100
95
|
merge:
|
|
@@ -109,57 +104,124 @@ RSpec:
|
|
|
109
104
|
- subject
|
|
110
105
|
- subject!
|
|
111
106
|
|
|
107
|
+
Metrics/BlockLength:
|
|
108
|
+
inherit_mode:
|
|
109
|
+
merge:
|
|
110
|
+
- Exclude
|
|
111
|
+
Exclude:
|
|
112
|
+
- "**/*_spec.rb"
|
|
113
|
+
- "**/spec/**/*"
|
|
114
|
+
|
|
112
115
|
RSpec/AlignLeftLetBrace:
|
|
113
116
|
Description: Checks that left braces for adjacent single line lets are aligned.
|
|
114
117
|
Enabled: false
|
|
115
118
|
VersionAdded: '1.16'
|
|
116
|
-
|
|
119
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AlignLeftLetBrace
|
|
117
120
|
|
|
118
121
|
RSpec/AlignRightLetBrace:
|
|
119
122
|
Description: Checks that right braces for adjacent single line lets are aligned.
|
|
120
123
|
Enabled: false
|
|
121
124
|
VersionAdded: '1.16'
|
|
122
|
-
|
|
125
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AlignRightLetBrace
|
|
123
126
|
|
|
124
127
|
RSpec/AnyInstance:
|
|
125
128
|
Description: Check that instances are not being stubbed globally.
|
|
126
129
|
Enabled: true
|
|
127
130
|
VersionAdded: '1.4'
|
|
128
|
-
StyleGuide: https://
|
|
131
|
+
StyleGuide: https://rspec.rubystyle.guide/#any_instance_of
|
|
132
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AnyInstance
|
|
129
133
|
|
|
130
134
|
RSpec/AroundBlock:
|
|
131
135
|
Description: Checks that around blocks actually run the test.
|
|
132
136
|
Enabled: true
|
|
133
137
|
VersionAdded: '1.11'
|
|
134
|
-
|
|
138
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AroundBlock
|
|
135
139
|
|
|
136
140
|
RSpec/Be:
|
|
137
141
|
Description: Check for expectations where `be` is used without argument.
|
|
138
142
|
Enabled: true
|
|
139
143
|
VersionAdded: '1.25'
|
|
140
|
-
StyleGuide: https://
|
|
144
|
+
StyleGuide: https://rspec.rubystyle.guide/#be-matcher
|
|
145
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Be
|
|
146
|
+
|
|
147
|
+
RSpec/BeEmpty:
|
|
148
|
+
Description: Prefer using `be_empty` when checking for an empty array.
|
|
149
|
+
Enabled: true
|
|
150
|
+
AutoCorrect: contextual
|
|
151
|
+
VersionAdded: '2.20'
|
|
152
|
+
VersionChanged: '2.31'
|
|
153
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEmpty
|
|
154
|
+
|
|
155
|
+
RSpec/BeEq:
|
|
156
|
+
Description: Check for expectations where `be(...)` can replace `eq(...)`.
|
|
157
|
+
Enabled: true
|
|
158
|
+
Safe: false
|
|
159
|
+
VersionAdded: 2.9.0
|
|
160
|
+
VersionChanged: '2.16'
|
|
161
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEq
|
|
141
162
|
|
|
142
163
|
RSpec/BeEql:
|
|
143
164
|
Description: Check for expectations where `be(...)` can replace `eql(...)`.
|
|
144
165
|
Enabled: true
|
|
166
|
+
Safe: false
|
|
145
167
|
VersionAdded: '1.7'
|
|
146
|
-
|
|
168
|
+
VersionChanged: '2.16'
|
|
169
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEql
|
|
170
|
+
|
|
171
|
+
RSpec/BeNil:
|
|
172
|
+
Description: Ensures a consistent style is used when matching `nil`.
|
|
173
|
+
Enabled: true
|
|
174
|
+
EnforcedStyle: be_nil
|
|
175
|
+
SupportedStyles:
|
|
176
|
+
- be
|
|
177
|
+
- be_nil
|
|
178
|
+
VersionAdded: 2.9.0
|
|
179
|
+
VersionChanged: 2.10.0
|
|
180
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeNil
|
|
147
181
|
|
|
148
182
|
RSpec/BeforeAfterAll:
|
|
149
|
-
Description: Check that before/after(:all) isn't being used.
|
|
183
|
+
Description: Check that before/after(:all/:context) isn't being used.
|
|
150
184
|
Enabled: true
|
|
151
185
|
Exclude:
|
|
152
|
-
- spec/spec_helper.rb
|
|
153
|
-
- spec/rails_helper.rb
|
|
154
|
-
- spec/support/**/*.rb
|
|
186
|
+
- "**/spec/spec_helper.rb"
|
|
187
|
+
- "**/spec/rails_helper.rb"
|
|
188
|
+
- "**/spec/support/**/*.rb"
|
|
155
189
|
VersionAdded: '1.12'
|
|
156
|
-
|
|
190
|
+
VersionChanged: '2.23'
|
|
191
|
+
StyleGuide: https://rspec.rubystyle.guide/#avoid-hooks-with-context-scope
|
|
192
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeforeAfterAll
|
|
193
|
+
|
|
194
|
+
RSpec/ChangeByZero:
|
|
195
|
+
Description: Prefer negated matchers over `to change.by(0)`.
|
|
196
|
+
Enabled: true
|
|
197
|
+
VersionAdded: '2.11'
|
|
198
|
+
VersionChanged: '2.14'
|
|
199
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ChangeByZero
|
|
200
|
+
NegatedMatcher: ~
|
|
201
|
+
|
|
202
|
+
RSpec/ClassCheck:
|
|
203
|
+
Description: Enforces consistent use of `be_a` or `be_kind_of`.
|
|
204
|
+
StyleGuide: "#is-a-vs-kind-of"
|
|
205
|
+
Enabled: true
|
|
206
|
+
VersionAdded: '2.13'
|
|
207
|
+
EnforcedStyle: be_a
|
|
208
|
+
SupportedStyles:
|
|
209
|
+
- be_a
|
|
210
|
+
- be_kind_of
|
|
211
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ClassCheck
|
|
212
|
+
|
|
213
|
+
RSpec/ContainExactly:
|
|
214
|
+
Description: Checks where `contain_exactly` is used.
|
|
215
|
+
Enabled: true
|
|
216
|
+
VersionAdded: '2.19'
|
|
217
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContainExactly
|
|
157
218
|
|
|
158
219
|
RSpec/ContextMethod:
|
|
159
220
|
Description: "`context` should not be used for specifying methods."
|
|
160
221
|
Enabled: true
|
|
161
222
|
VersionAdded: '1.36'
|
|
162
|
-
StyleGuide: https://
|
|
223
|
+
StyleGuide: https://rspec.rubystyle.guide/#example-group-naming
|
|
224
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextMethod
|
|
163
225
|
|
|
164
226
|
RSpec/ContextWording:
|
|
165
227
|
Description: Checks that `context` docstring starts with an allowed prefix.
|
|
@@ -168,9 +230,11 @@ RSpec/ContextWording:
|
|
|
168
230
|
- when
|
|
169
231
|
- with
|
|
170
232
|
- without
|
|
233
|
+
AllowedPatterns: []
|
|
171
234
|
VersionAdded: '1.20'
|
|
172
|
-
VersionChanged:
|
|
173
|
-
StyleGuide: https://
|
|
235
|
+
VersionChanged: '2.13'
|
|
236
|
+
StyleGuide: https://rspec.rubystyle.guide/#context-descriptions
|
|
237
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextWording
|
|
174
238
|
|
|
175
239
|
RSpec/DescribeClass:
|
|
176
240
|
Description: Check that the first argument to the top-level describe is a constant.
|
|
@@ -199,19 +263,19 @@ RSpec/DescribeClass:
|
|
|
199
263
|
- task
|
|
200
264
|
VersionAdded: '1.0'
|
|
201
265
|
VersionChanged: '2.7'
|
|
202
|
-
|
|
266
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass
|
|
203
267
|
|
|
204
268
|
RSpec/DescribeMethod:
|
|
205
269
|
Description: Checks that the second argument to `describe` specifies a method.
|
|
206
270
|
Enabled: true
|
|
207
271
|
VersionAdded: '1.0'
|
|
208
|
-
|
|
272
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeMethod
|
|
209
273
|
|
|
210
274
|
RSpec/DescribeSymbol:
|
|
211
275
|
Description: Avoid describing symbols.
|
|
212
276
|
Enabled: true
|
|
213
277
|
VersionAdded: '1.15'
|
|
214
|
-
|
|
278
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeSymbol
|
|
215
279
|
|
|
216
280
|
RSpec/DescribedClass:
|
|
217
281
|
Description: Checks that tests use `described_class`.
|
|
@@ -221,67 +285,105 @@ RSpec/DescribedClass:
|
|
|
221
285
|
SupportedStyles:
|
|
222
286
|
- described_class
|
|
223
287
|
- explicit
|
|
288
|
+
OnlyStaticConstants: true
|
|
224
289
|
SafeAutoCorrect: false
|
|
225
290
|
VersionAdded: '1.0'
|
|
226
|
-
VersionChanged: '
|
|
227
|
-
|
|
291
|
+
VersionChanged: '2.27'
|
|
292
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribedClass
|
|
228
293
|
|
|
229
294
|
RSpec/DescribedClassModuleWrapping:
|
|
230
295
|
Description: Avoid opening modules and defining specs within them.
|
|
231
296
|
Enabled: false
|
|
232
297
|
VersionAdded: '1.37'
|
|
233
|
-
|
|
298
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribedClassModuleWrapping
|
|
234
299
|
|
|
235
300
|
RSpec/Dialect:
|
|
236
|
-
Description:
|
|
301
|
+
Description: Enforces custom RSpec dialects.
|
|
237
302
|
Enabled: false
|
|
238
303
|
PreferredMethods: {}
|
|
239
304
|
VersionAdded: '1.33'
|
|
240
|
-
|
|
305
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Dialect
|
|
306
|
+
|
|
307
|
+
RSpec/DuplicatedMetadata:
|
|
308
|
+
Description: Avoid duplicated metadata.
|
|
309
|
+
Enabled: true
|
|
310
|
+
VersionAdded: '2.16'
|
|
311
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DuplicatedMetadata
|
|
241
312
|
|
|
242
313
|
RSpec/EmptyExampleGroup:
|
|
243
314
|
Description: Checks if an example group does not include any tests.
|
|
244
315
|
Enabled: true
|
|
316
|
+
AutoCorrect: contextual
|
|
317
|
+
SafeAutoCorrect: false
|
|
245
318
|
VersionAdded: '1.7'
|
|
246
|
-
VersionChanged: '2.
|
|
247
|
-
|
|
319
|
+
VersionChanged: '2.31'
|
|
320
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyExampleGroup
|
|
248
321
|
|
|
249
322
|
RSpec/EmptyHook:
|
|
250
323
|
Description: Checks for empty before and after hooks.
|
|
251
324
|
Enabled: true
|
|
325
|
+
AutoCorrect: contextual
|
|
252
326
|
VersionAdded: '1.39'
|
|
253
|
-
|
|
327
|
+
VersionChanged: '2.31'
|
|
328
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyHook
|
|
254
329
|
|
|
255
330
|
RSpec/EmptyLineAfterExample:
|
|
256
331
|
Description: Checks if there is an empty line after example blocks.
|
|
257
332
|
Enabled: true
|
|
258
333
|
AllowConsecutiveOneLiners: true
|
|
259
334
|
VersionAdded: '1.36'
|
|
260
|
-
StyleGuide: https://
|
|
335
|
+
StyleGuide: https://rspec.rubystyle.guide/#empty-lines-around-examples
|
|
336
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterExample
|
|
261
337
|
|
|
262
338
|
RSpec/EmptyLineAfterExampleGroup:
|
|
263
339
|
Description: Checks if there is an empty line after example group blocks.
|
|
264
340
|
Enabled: true
|
|
265
341
|
VersionAdded: '1.27'
|
|
266
|
-
StyleGuide: https://
|
|
342
|
+
StyleGuide: https://rspec.rubystyle.guide/#empty-lines-between-describes
|
|
343
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterExampleGroup
|
|
267
344
|
|
|
268
345
|
RSpec/EmptyLineAfterFinalLet:
|
|
269
346
|
Description: Checks if there is an empty line after the last let block.
|
|
270
347
|
Enabled: true
|
|
271
348
|
VersionAdded: '1.14'
|
|
272
|
-
StyleGuide: https://
|
|
349
|
+
StyleGuide: https://rspec.rubystyle.guide/#empty-line-after-let
|
|
350
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterFinalLet
|
|
273
351
|
|
|
274
352
|
RSpec/EmptyLineAfterHook:
|
|
275
353
|
Description: Checks if there is an empty line after hook blocks.
|
|
276
354
|
Enabled: true
|
|
277
355
|
VersionAdded: '1.27'
|
|
278
|
-
|
|
356
|
+
VersionChanged: '2.13'
|
|
357
|
+
StyleGuide: https://rspec.rubystyle.guide/#empty-line-after-let
|
|
358
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterHook
|
|
359
|
+
AllowConsecutiveOneLiners: true
|
|
279
360
|
|
|
280
361
|
RSpec/EmptyLineAfterSubject:
|
|
281
362
|
Description: Checks if there is an empty line after subject block.
|
|
282
363
|
Enabled: true
|
|
283
364
|
VersionAdded: '1.14'
|
|
284
|
-
StyleGuide: https://
|
|
365
|
+
StyleGuide: https://rspec.rubystyle.guide/#empty-line-after-let
|
|
366
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterSubject
|
|
367
|
+
|
|
368
|
+
RSpec/EmptyMetadata:
|
|
369
|
+
Description: Avoid empty metadata hash.
|
|
370
|
+
Enabled: true
|
|
371
|
+
AutoCorrect: contextual
|
|
372
|
+
VersionAdded: '2.24'
|
|
373
|
+
VersionChanged: '2.31'
|
|
374
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyMetadata
|
|
375
|
+
|
|
376
|
+
RSpec/EmptyOutput:
|
|
377
|
+
Description: Check that the `output` matcher is not called with an empty string.
|
|
378
|
+
Enabled: true
|
|
379
|
+
VersionAdded: '2.29'
|
|
380
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyOutput
|
|
381
|
+
|
|
382
|
+
RSpec/Eq:
|
|
383
|
+
Description: Use `eq` instead of `be ==` to compare objects.
|
|
384
|
+
Enabled: true
|
|
385
|
+
VersionAdded: '2.24'
|
|
386
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Eq
|
|
285
387
|
|
|
286
388
|
RSpec/ExampleLength:
|
|
287
389
|
Description: Checks for long examples.
|
|
@@ -290,7 +392,7 @@ RSpec/ExampleLength:
|
|
|
290
392
|
CountAsOne: []
|
|
291
393
|
VersionAdded: '1.5'
|
|
292
394
|
VersionChanged: '2.3'
|
|
293
|
-
|
|
395
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleLength
|
|
294
396
|
|
|
295
397
|
RSpec/ExampleWithoutDescription:
|
|
296
398
|
Description: Checks for examples without a description.
|
|
@@ -301,13 +403,8 @@ RSpec/ExampleWithoutDescription:
|
|
|
301
403
|
- single_line_only
|
|
302
404
|
- disallow
|
|
303
405
|
VersionAdded: '1.22'
|
|
304
|
-
StyleGuide: https://
|
|
305
|
-
|
|
306
|
-
RSpec/ExcessiveDocstringSpacing:
|
|
307
|
-
Description: Checks for excessive whitespace in example descriptions.
|
|
308
|
-
Enabled: pending
|
|
309
|
-
VersionAdded: '2.5'
|
|
310
|
-
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExcessiveDocstringSpacing
|
|
406
|
+
StyleGuide: https://rspec.rubystyle.guide/#it-and-specify
|
|
407
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWithoutDescription
|
|
311
408
|
|
|
312
409
|
RSpec/ExampleWording:
|
|
313
410
|
Description: Checks for common mistakes in example descriptions.
|
|
@@ -318,17 +415,27 @@ RSpec/ExampleWording:
|
|
|
318
415
|
have: has
|
|
319
416
|
HAVE: HAS
|
|
320
417
|
IgnoredWords: []
|
|
418
|
+
DisallowedExamples:
|
|
419
|
+
- works
|
|
321
420
|
VersionAdded: '1.0'
|
|
322
|
-
VersionChanged: '
|
|
323
|
-
StyleGuide: https://
|
|
421
|
+
VersionChanged: '2.13'
|
|
422
|
+
StyleGuide: https://rspec.rubystyle.guide/#should-in-example-docstrings
|
|
423
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
|
|
424
|
+
|
|
425
|
+
RSpec/ExcessiveDocstringSpacing:
|
|
426
|
+
Description: Checks for excessive whitespace in example descriptions.
|
|
427
|
+
Enabled: true
|
|
428
|
+
VersionAdded: '2.5'
|
|
429
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExcessiveDocstringSpacing
|
|
324
430
|
|
|
325
431
|
RSpec/ExpectActual:
|
|
326
432
|
Description: Checks for `expect(...)` calls containing literal values.
|
|
327
433
|
Enabled: true
|
|
328
434
|
Exclude:
|
|
329
|
-
- spec/routing/**/*
|
|
435
|
+
- "**/spec/routing/**/*"
|
|
330
436
|
VersionAdded: '1.7'
|
|
331
|
-
|
|
437
|
+
VersionChanged: '2.23'
|
|
438
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectActual
|
|
332
439
|
|
|
333
440
|
RSpec/ExpectChange:
|
|
334
441
|
Description: Checks for consistent style of change matcher.
|
|
@@ -340,41 +447,33 @@ RSpec/ExpectChange:
|
|
|
340
447
|
SafeAutoCorrect: false
|
|
341
448
|
VersionAdded: '1.22'
|
|
342
449
|
VersionChanged: '2.5'
|
|
343
|
-
|
|
450
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectChange
|
|
344
451
|
|
|
345
452
|
RSpec/ExpectInHook:
|
|
346
453
|
Description: Do not use `expect` in hooks such as `before`.
|
|
347
454
|
Enabled: true
|
|
348
455
|
VersionAdded: '1.16'
|
|
349
|
-
|
|
456
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectInHook
|
|
457
|
+
|
|
458
|
+
RSpec/ExpectInLet:
|
|
459
|
+
Description: Do not use `expect` in let.
|
|
460
|
+
Enabled: true
|
|
461
|
+
VersionAdded: '2.30'
|
|
462
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectInLet
|
|
350
463
|
|
|
351
464
|
RSpec/ExpectOutput:
|
|
352
465
|
Description: Checks for opportunities to use `expect { ... }.to output`.
|
|
353
466
|
Enabled: true
|
|
354
467
|
VersionAdded: '1.10'
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
RSpec/FilePath:
|
|
358
|
-
Description: Checks that spec file paths are consistent and well-formed.
|
|
359
|
-
Enabled: true
|
|
360
|
-
Include:
|
|
361
|
-
- "**/*_spec*rb*"
|
|
362
|
-
- "**/spec/**/*"
|
|
363
|
-
CustomTransform:
|
|
364
|
-
RuboCop: rubocop
|
|
365
|
-
RSpec: rspec
|
|
366
|
-
IgnoreMethods: false
|
|
367
|
-
SpecSuffixOnly: false
|
|
368
|
-
VersionAdded: '1.2'
|
|
369
|
-
VersionChanged: '1.40'
|
|
370
|
-
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath
|
|
468
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectOutput
|
|
371
469
|
|
|
372
470
|
RSpec/Focus:
|
|
373
471
|
Description: Checks if examples are focused.
|
|
374
472
|
Enabled: true
|
|
473
|
+
AutoCorrect: contextual
|
|
375
474
|
VersionAdded: '1.5'
|
|
376
|
-
VersionChanged: '2.
|
|
377
|
-
|
|
475
|
+
VersionChanged: '2.31'
|
|
476
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Focus
|
|
378
477
|
|
|
379
478
|
RSpec/HookArgument:
|
|
380
479
|
Description: Checks the arguments passed to `before`, `around`, and `after`.
|
|
@@ -385,25 +484,29 @@ RSpec/HookArgument:
|
|
|
385
484
|
- each
|
|
386
485
|
- example
|
|
387
486
|
VersionAdded: '1.7'
|
|
388
|
-
StyleGuide: https://
|
|
487
|
+
StyleGuide: https://rspec.rubystyle.guide/#redundant-beforeeach
|
|
488
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HookArgument
|
|
389
489
|
|
|
390
490
|
RSpec/HooksBeforeExamples:
|
|
391
491
|
Description: Checks for before/around/after hooks that come after an example.
|
|
392
492
|
Enabled: true
|
|
493
|
+
AutoCorrect: contextual
|
|
393
494
|
VersionAdded: '1.29'
|
|
394
|
-
|
|
495
|
+
VersionChanged: '2.31'
|
|
496
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HooksBeforeExamples
|
|
395
497
|
|
|
396
498
|
RSpec/IdenticalEqualityAssertion:
|
|
397
499
|
Description: Checks for equality assertions with identical expressions on both sides.
|
|
398
|
-
Enabled:
|
|
500
|
+
Enabled: true
|
|
399
501
|
VersionAdded: '2.4'
|
|
400
|
-
|
|
502
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IdenticalEqualityAssertion
|
|
401
503
|
|
|
402
504
|
RSpec/ImplicitBlockExpectation:
|
|
403
505
|
Description: Check that implicit block expectation syntax is not used.
|
|
404
506
|
Enabled: true
|
|
405
507
|
VersionAdded: '1.35'
|
|
406
|
-
StyleGuide: https://
|
|
508
|
+
StyleGuide: https://rspec.rubystyle.guide/#implicit-block-expectations
|
|
509
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitBlockExpectation
|
|
407
510
|
|
|
408
511
|
RSpec/ImplicitExpect:
|
|
409
512
|
Description: Check that a consistent implicit expectation style is used.
|
|
@@ -413,7 +516,8 @@ RSpec/ImplicitExpect:
|
|
|
413
516
|
- is_expected
|
|
414
517
|
- should
|
|
415
518
|
VersionAdded: '1.8'
|
|
416
|
-
StyleGuide: https://
|
|
519
|
+
StyleGuide: https://rspec.rubystyle.guide/#use-expect
|
|
520
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitExpect
|
|
417
521
|
|
|
418
522
|
RSpec/ImplicitSubject:
|
|
419
523
|
Description: Checks for usage of implicit subject (`is_expected` / `should`).
|
|
@@ -423,15 +527,34 @@ RSpec/ImplicitSubject:
|
|
|
423
527
|
- single_line_only
|
|
424
528
|
- single_statement_only
|
|
425
529
|
- disallow
|
|
530
|
+
- require_implicit
|
|
426
531
|
VersionAdded: '1.29'
|
|
427
|
-
VersionChanged: '
|
|
428
|
-
|
|
532
|
+
VersionChanged: '2.13'
|
|
533
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitSubject
|
|
534
|
+
|
|
535
|
+
RSpec/IncludeExamples:
|
|
536
|
+
Description: Checks for usage of `include_examples`.
|
|
537
|
+
Enabled: true
|
|
538
|
+
SafeAutoCorrect: false
|
|
539
|
+
VersionAdded: '3.6'
|
|
540
|
+
VersionChanged: '3.7'
|
|
541
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IncludeExamples
|
|
542
|
+
|
|
543
|
+
RSpec/IndexedLet:
|
|
544
|
+
Description: Do not set up test data using indexes (e.g., `item_1`, `item_2`).
|
|
545
|
+
Enabled: true
|
|
546
|
+
VersionAdded: '2.20'
|
|
547
|
+
VersionChanged: '2.23'
|
|
548
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IndexedLet
|
|
549
|
+
Max: 1
|
|
550
|
+
AllowedIdentifiers: []
|
|
551
|
+
AllowedPatterns: []
|
|
429
552
|
|
|
430
553
|
RSpec/InstanceSpy:
|
|
431
554
|
Description: Checks for `instance_double` used with `have_received`.
|
|
432
555
|
Enabled: true
|
|
433
556
|
VersionAdded: '1.12'
|
|
434
|
-
|
|
557
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceSpy
|
|
435
558
|
|
|
436
559
|
RSpec/InstanceVariable:
|
|
437
560
|
Description: Checks for instance variable usage in specs.
|
|
@@ -439,7 +562,15 @@ RSpec/InstanceVariable:
|
|
|
439
562
|
AssignmentOnly: false
|
|
440
563
|
VersionAdded: '1.0'
|
|
441
564
|
VersionChanged: '1.7'
|
|
442
|
-
StyleGuide: https://
|
|
565
|
+
StyleGuide: https://rspec.rubystyle.guide/#instance-variables
|
|
566
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable
|
|
567
|
+
|
|
568
|
+
RSpec/IsExpectedSpecify:
|
|
569
|
+
Description: Check for `specify` with `is_expected` and one-liner expectations.
|
|
570
|
+
Enabled: true
|
|
571
|
+
VersionAdded: '2.27'
|
|
572
|
+
StyleGuide: https://rspec.rubystyle.guide/#it-and-specify
|
|
573
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IsExpectedSpecify
|
|
443
574
|
|
|
444
575
|
RSpec/ItBehavesLike:
|
|
445
576
|
Description: Checks that only one `it_behaves_like` style is used.
|
|
@@ -449,45 +580,60 @@ RSpec/ItBehavesLike:
|
|
|
449
580
|
- it_behaves_like
|
|
450
581
|
- it_should_behave_like
|
|
451
582
|
VersionAdded: '1.13'
|
|
452
|
-
|
|
583
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ItBehavesLike
|
|
453
584
|
|
|
454
585
|
RSpec/IteratedExpectation:
|
|
455
586
|
Description: Check that `all` matcher is used instead of iterating over an array.
|
|
456
587
|
Enabled: true
|
|
457
588
|
VersionAdded: '1.14'
|
|
458
|
-
|
|
589
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IteratedExpectation
|
|
459
590
|
|
|
460
591
|
RSpec/LeadingSubject:
|
|
461
592
|
Description: Enforce that subject is the first definition in the test.
|
|
462
593
|
Enabled: true
|
|
463
594
|
VersionAdded: '1.7'
|
|
464
595
|
VersionChanged: '1.14'
|
|
465
|
-
StyleGuide: https://
|
|
596
|
+
StyleGuide: https://rspec.rubystyle.guide/#leading-subject
|
|
597
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LeadingSubject
|
|
466
598
|
|
|
467
599
|
RSpec/LeakyConstantDeclaration:
|
|
468
600
|
Description: Checks that no class, module, or constant is declared.
|
|
469
601
|
Enabled: true
|
|
470
602
|
VersionAdded: '1.35'
|
|
471
|
-
StyleGuide: https://
|
|
603
|
+
StyleGuide: https://rspec.rubystyle.guide/#declare-constants
|
|
604
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LeakyConstantDeclaration
|
|
605
|
+
|
|
606
|
+
RSpec/LeakyLocalVariable:
|
|
607
|
+
Description: Checks for local variables from outer scopes used inside examples.
|
|
608
|
+
Enabled: true
|
|
609
|
+
VersionAdded: '3.8'
|
|
610
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LeakyLocalVariable
|
|
472
611
|
|
|
473
612
|
RSpec/LetBeforeExamples:
|
|
474
613
|
Description: Checks for `let` definitions that come after an example.
|
|
475
614
|
Enabled: true
|
|
615
|
+
AutoCorrect: contextual
|
|
476
616
|
VersionAdded: '1.16'
|
|
477
|
-
VersionChanged: '
|
|
478
|
-
|
|
617
|
+
VersionChanged: '2.31'
|
|
618
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetBeforeExamples
|
|
479
619
|
|
|
480
620
|
RSpec/LetSetup:
|
|
481
621
|
Description: Checks unreferenced `let!` calls being used for test setup.
|
|
482
622
|
Enabled: true
|
|
483
623
|
VersionAdded: '1.7'
|
|
484
|
-
|
|
624
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetSetup
|
|
625
|
+
|
|
626
|
+
RSpec/MatchArray:
|
|
627
|
+
Description: Checks where `match_array` is used.
|
|
628
|
+
Enabled: true
|
|
629
|
+
VersionAdded: '2.19'
|
|
630
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MatchArray
|
|
485
631
|
|
|
486
632
|
RSpec/MessageChain:
|
|
487
633
|
Description: Check that chains of messages are not being stubbed.
|
|
488
634
|
Enabled: true
|
|
489
635
|
VersionAdded: '1.7'
|
|
490
|
-
|
|
636
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageChain
|
|
491
637
|
|
|
492
638
|
RSpec/MessageExpectation:
|
|
493
639
|
Description: Checks for consistent message expectation style.
|
|
@@ -498,7 +644,7 @@ RSpec/MessageExpectation:
|
|
|
498
644
|
- expect
|
|
499
645
|
VersionAdded: '1.7'
|
|
500
646
|
VersionChanged: '1.8'
|
|
501
|
-
|
|
647
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageExpectation
|
|
502
648
|
|
|
503
649
|
RSpec/MessageSpies:
|
|
504
650
|
Description: Checks that message expectations are set using spies.
|
|
@@ -508,19 +654,35 @@ RSpec/MessageSpies:
|
|
|
508
654
|
- have_received
|
|
509
655
|
- receive
|
|
510
656
|
VersionAdded: '1.9'
|
|
511
|
-
|
|
657
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies
|
|
658
|
+
|
|
659
|
+
RSpec/MetadataStyle:
|
|
660
|
+
Description: Use consistent metadata style.
|
|
661
|
+
Enabled: true
|
|
662
|
+
EnforcedStyle: symbol
|
|
663
|
+
SupportedStyles:
|
|
664
|
+
- hash
|
|
665
|
+
- symbol
|
|
666
|
+
VersionAdded: '2.24'
|
|
667
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MetadataStyle
|
|
512
668
|
|
|
513
669
|
RSpec/MissingExampleGroupArgument:
|
|
514
670
|
Description: Checks that the first argument to an example group is not empty.
|
|
515
671
|
Enabled: true
|
|
516
672
|
VersionAdded: '1.28'
|
|
517
|
-
|
|
673
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExampleGroupArgument
|
|
674
|
+
|
|
675
|
+
RSpec/MissingExpectationTargetMethod:
|
|
676
|
+
Description: Checks if `.to`, `not_to` or `to_not` are used.
|
|
677
|
+
Enabled: true
|
|
678
|
+
VersionAdded: '3.0'
|
|
679
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExpectationTargetMethod
|
|
518
680
|
|
|
519
681
|
RSpec/MultipleDescribes:
|
|
520
682
|
Description: Checks for multiple top-level example groups.
|
|
521
683
|
Enabled: true
|
|
522
684
|
VersionAdded: '1.0'
|
|
523
|
-
|
|
685
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleDescribes
|
|
524
686
|
|
|
525
687
|
RSpec/MultipleExpectations:
|
|
526
688
|
Description: Checks if examples contain too many `expect` calls.
|
|
@@ -528,7 +690,8 @@ RSpec/MultipleExpectations:
|
|
|
528
690
|
Max: 1
|
|
529
691
|
VersionAdded: '1.7'
|
|
530
692
|
VersionChanged: '1.21'
|
|
531
|
-
StyleGuide: https://
|
|
693
|
+
StyleGuide: https://rspec.rubystyle.guide/#expectation-per-example
|
|
694
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleExpectations
|
|
532
695
|
|
|
533
696
|
RSpec/MultipleMemoizedHelpers:
|
|
534
697
|
Description: Checks if example groups contain too many `let` and `subject` calls.
|
|
@@ -536,28 +699,47 @@ RSpec/MultipleMemoizedHelpers:
|
|
|
536
699
|
AllowSubject: true
|
|
537
700
|
Max: 5
|
|
538
701
|
VersionAdded: '1.43'
|
|
539
|
-
StyleGuide: https://
|
|
702
|
+
StyleGuide: https://rspec.rubystyle.guide/#let-blocks
|
|
703
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleMemoizedHelpers
|
|
540
704
|
|
|
541
705
|
RSpec/MultipleSubjects:
|
|
542
706
|
Description: Checks if an example group defines `subject` multiple times.
|
|
543
707
|
Enabled: true
|
|
544
708
|
VersionAdded: '1.16'
|
|
545
|
-
|
|
709
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleSubjects
|
|
546
710
|
|
|
547
711
|
RSpec/NamedSubject:
|
|
548
712
|
Description: Checks for explicitly referenced test subjects.
|
|
549
713
|
Enabled: true
|
|
714
|
+
EnforcedStyle: always
|
|
715
|
+
SupportedStyles:
|
|
716
|
+
- always
|
|
717
|
+
- named_only
|
|
550
718
|
IgnoreSharedExamples: true
|
|
551
719
|
VersionAdded: 1.5.3
|
|
552
|
-
|
|
720
|
+
VersionChanged: '2.15'
|
|
721
|
+
StyleGuide: https://rspec.rubystyle.guide/#use-subject
|
|
722
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NamedSubject
|
|
553
723
|
|
|
554
724
|
RSpec/NestedGroups:
|
|
555
725
|
Description: Checks for nested example groups.
|
|
556
726
|
Enabled: true
|
|
557
727
|
Max: 3
|
|
728
|
+
AllowedGroups: []
|
|
558
729
|
VersionAdded: '1.7'
|
|
559
|
-
VersionChanged: '
|
|
560
|
-
|
|
730
|
+
VersionChanged: '2.13'
|
|
731
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups
|
|
732
|
+
|
|
733
|
+
RSpec/NoExpectationExample:
|
|
734
|
+
Description: Checks if an example contains any expectation.
|
|
735
|
+
Enabled: true
|
|
736
|
+
Safe: false
|
|
737
|
+
VersionAdded: '2.13'
|
|
738
|
+
VersionChanged: '2.14'
|
|
739
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NoExpectationExample
|
|
740
|
+
AllowedPatterns:
|
|
741
|
+
- "^expect_"
|
|
742
|
+
- "^assert_"
|
|
561
743
|
|
|
562
744
|
RSpec/NotToNot:
|
|
563
745
|
Description: Checks for consistent method usage for negating expectations.
|
|
@@ -567,19 +749,33 @@ RSpec/NotToNot:
|
|
|
567
749
|
- not_to
|
|
568
750
|
- to_not
|
|
569
751
|
VersionAdded: '1.4'
|
|
570
|
-
|
|
752
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
|
|
571
753
|
|
|
572
754
|
RSpec/OverwritingSetup:
|
|
573
755
|
Description: Checks if there is a let/subject that overwrites an existing one.
|
|
574
756
|
Enabled: true
|
|
575
757
|
VersionAdded: '1.14'
|
|
576
|
-
|
|
758
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/OverwritingSetup
|
|
759
|
+
|
|
760
|
+
RSpec/Output:
|
|
761
|
+
Description: Checks for the use of output calls like puts and print in specs.
|
|
762
|
+
Enabled: true
|
|
763
|
+
AutoCorrect: contextual
|
|
764
|
+
SafeAutoCorrect: false
|
|
765
|
+
VersionAdded: '3.9'
|
|
766
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Output
|
|
577
767
|
|
|
578
768
|
RSpec/Pending:
|
|
579
769
|
Description: Checks for any pending or skipped examples.
|
|
580
770
|
Enabled: false
|
|
581
771
|
VersionAdded: '1.25'
|
|
582
|
-
|
|
772
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Pending
|
|
773
|
+
|
|
774
|
+
RSpec/PendingWithoutReason:
|
|
775
|
+
Description: Checks for pending or skipped examples without reason.
|
|
776
|
+
Enabled: true
|
|
777
|
+
VersionAdded: '2.16'
|
|
778
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PendingWithoutReason
|
|
583
779
|
|
|
584
780
|
RSpec/PredicateMatcher:
|
|
585
781
|
Description: Prefer using predicate matcher over using predicate method directly.
|
|
@@ -592,49 +788,81 @@ RSpec/PredicateMatcher:
|
|
|
592
788
|
- explicit
|
|
593
789
|
SafeAutoCorrect: false
|
|
594
790
|
VersionAdded: '1.16'
|
|
595
|
-
StyleGuide: https://
|
|
791
|
+
StyleGuide: https://rspec.rubystyle.guide/#predicate-matchers
|
|
792
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PredicateMatcher
|
|
596
793
|
|
|
597
794
|
RSpec/ReceiveCounts:
|
|
598
795
|
Description: Check for `once` and `twice` receive counts matchers usage.
|
|
599
796
|
Enabled: true
|
|
600
797
|
VersionAdded: '1.26'
|
|
601
|
-
|
|
798
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveCounts
|
|
799
|
+
|
|
800
|
+
RSpec/ReceiveMessages:
|
|
801
|
+
Description: Checks for multiple messages stubbed on the same object.
|
|
802
|
+
Enabled: true
|
|
803
|
+
SafeAutoCorrect: false
|
|
804
|
+
VersionAdded: '2.23'
|
|
805
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveMessages
|
|
602
806
|
|
|
603
807
|
RSpec/ReceiveNever:
|
|
604
808
|
Description: Prefer `not_to receive(...)` over `receive(...).never`.
|
|
605
809
|
Enabled: true
|
|
606
810
|
VersionAdded: '1.28'
|
|
607
|
-
|
|
811
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveNever
|
|
812
|
+
|
|
813
|
+
RSpec/RedundantAround:
|
|
814
|
+
Description: Remove redundant `around` hook.
|
|
815
|
+
Enabled: true
|
|
816
|
+
VersionAdded: '2.19'
|
|
817
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RedundantAround
|
|
818
|
+
|
|
819
|
+
RSpec/RedundantPredicateMatcher:
|
|
820
|
+
Description: Checks for redundant predicate matcher.
|
|
821
|
+
Enabled: true
|
|
822
|
+
VersionAdded: '2.26'
|
|
823
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RedundantPredicateMatcher
|
|
824
|
+
|
|
825
|
+
RSpec/RemoveConst:
|
|
826
|
+
Description: Checks that `remove_const` is not used in specs.
|
|
827
|
+
Enabled: true
|
|
828
|
+
VersionAdded: '2.26'
|
|
829
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RemoveConst
|
|
608
830
|
|
|
609
831
|
RSpec/RepeatedDescription:
|
|
610
832
|
Description: Check for repeated description strings in example groups.
|
|
611
833
|
Enabled: true
|
|
612
834
|
VersionAdded: '1.9'
|
|
613
|
-
|
|
835
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription
|
|
614
836
|
|
|
615
837
|
RSpec/RepeatedExample:
|
|
616
838
|
Description: Check for repeated examples within example groups.
|
|
617
839
|
Enabled: true
|
|
618
840
|
VersionAdded: '1.10'
|
|
619
|
-
|
|
841
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample
|
|
620
842
|
|
|
621
843
|
RSpec/RepeatedExampleGroupBody:
|
|
622
844
|
Description: Check for repeated describe and context block body.
|
|
623
845
|
Enabled: true
|
|
624
846
|
VersionAdded: '1.38'
|
|
625
|
-
|
|
847
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExampleGroupBody
|
|
626
848
|
|
|
627
849
|
RSpec/RepeatedExampleGroupDescription:
|
|
628
850
|
Description: Check for repeated example group descriptions.
|
|
629
851
|
Enabled: true
|
|
630
852
|
VersionAdded: '1.38'
|
|
631
|
-
|
|
853
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExampleGroupDescription
|
|
632
854
|
|
|
633
855
|
RSpec/RepeatedIncludeExample:
|
|
634
856
|
Description: Check for repeated include of shared examples.
|
|
635
857
|
Enabled: true
|
|
636
858
|
VersionAdded: '1.44'
|
|
637
|
-
|
|
859
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedIncludeExample
|
|
860
|
+
|
|
861
|
+
RSpec/RepeatedSubjectCall:
|
|
862
|
+
Description: Checks for repeated calls to subject missing that it is memoized.
|
|
863
|
+
Enabled: true
|
|
864
|
+
VersionAdded: '2.27'
|
|
865
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedSubjectCall
|
|
638
866
|
|
|
639
867
|
RSpec/ReturnFromStub:
|
|
640
868
|
Description: Checks for consistent style of stub's return setting.
|
|
@@ -645,63 +873,122 @@ RSpec/ReturnFromStub:
|
|
|
645
873
|
- block
|
|
646
874
|
VersionAdded: '1.16'
|
|
647
875
|
VersionChanged: '1.22'
|
|
648
|
-
|
|
876
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReturnFromStub
|
|
649
877
|
|
|
650
878
|
RSpec/ScatteredLet:
|
|
651
879
|
Description: Checks for let scattered across the example group.
|
|
652
880
|
Enabled: true
|
|
881
|
+
AutoCorrect: contextual
|
|
653
882
|
VersionAdded: '1.14'
|
|
654
|
-
VersionChanged: '
|
|
655
|
-
|
|
883
|
+
VersionChanged: '2.31'
|
|
884
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredLet
|
|
656
885
|
|
|
657
886
|
RSpec/ScatteredSetup:
|
|
658
887
|
Description: Checks for setup scattered across multiple hooks in an example group.
|
|
659
888
|
Enabled: true
|
|
889
|
+
AutoCorrect: contextual
|
|
660
890
|
VersionAdded: '1.10'
|
|
661
|
-
|
|
891
|
+
VersionChanged: '2.31'
|
|
892
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredSetup
|
|
662
893
|
|
|
663
894
|
RSpec/SharedContext:
|
|
664
895
|
Description: Checks for proper shared_context and shared_examples usage.
|
|
665
896
|
Enabled: true
|
|
666
897
|
VersionAdded: '1.13'
|
|
667
|
-
|
|
898
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedContext
|
|
668
899
|
|
|
669
900
|
RSpec/SharedExamples:
|
|
670
|
-
Description:
|
|
901
|
+
Description: Checks for consistent style for shared example names.
|
|
671
902
|
Enabled: true
|
|
903
|
+
EnforcedStyle: string
|
|
904
|
+
SupportedStyles:
|
|
905
|
+
- string
|
|
906
|
+
- symbol
|
|
672
907
|
VersionAdded: '1.25'
|
|
673
|
-
|
|
908
|
+
VersionChanged: '2.26'
|
|
909
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedExamples
|
|
674
910
|
|
|
675
911
|
RSpec/SingleArgumentMessageChain:
|
|
676
912
|
Description: Checks that chains of messages contain more than one element.
|
|
677
913
|
Enabled: true
|
|
678
914
|
VersionAdded: '1.9'
|
|
679
915
|
VersionChanged: '1.10'
|
|
680
|
-
|
|
916
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SingleArgumentMessageChain
|
|
917
|
+
|
|
918
|
+
RSpec/SkipBlockInsideExample:
|
|
919
|
+
Description: Checks for passing a block to `skip` within examples.
|
|
920
|
+
Enabled: true
|
|
921
|
+
VersionAdded: '2.19'
|
|
922
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SkipBlockInsideExample
|
|
923
|
+
|
|
924
|
+
RSpec/SortMetadata:
|
|
925
|
+
Description: Sort RSpec metadata alphabetically.
|
|
926
|
+
Enabled: true
|
|
927
|
+
VersionAdded: '2.14'
|
|
928
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SortMetadata
|
|
929
|
+
|
|
930
|
+
RSpec/SpecFilePathFormat:
|
|
931
|
+
Description: Checks that spec file paths are consistent and well-formed.
|
|
932
|
+
Enabled: true
|
|
933
|
+
Include:
|
|
934
|
+
- "**/*_spec.rb"
|
|
935
|
+
Exclude:
|
|
936
|
+
- "**/spec/routing/**/*"
|
|
937
|
+
CustomTransform:
|
|
938
|
+
RuboCop: rubocop
|
|
939
|
+
RSpec: rspec
|
|
940
|
+
IgnoreMethods: false
|
|
941
|
+
IgnoreMetadata:
|
|
942
|
+
type: routing
|
|
943
|
+
InflectorPath: "./config/initializers/inflections.rb"
|
|
944
|
+
SupportedInflectors:
|
|
945
|
+
- default
|
|
946
|
+
- active_support
|
|
947
|
+
EnforcedInflector: default
|
|
948
|
+
VersionAdded: '2.24'
|
|
949
|
+
VersionChanged: '3.8'
|
|
950
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SpecFilePathFormat
|
|
951
|
+
|
|
952
|
+
RSpec/SpecFilePathSuffix:
|
|
953
|
+
Description: Checks that spec file paths suffix are consistent and well-formed.
|
|
954
|
+
Enabled: true
|
|
955
|
+
VersionAdded: '2.24'
|
|
956
|
+
Include:
|
|
957
|
+
- "**/*_spec*rb*"
|
|
958
|
+
- "**/spec/**/*"
|
|
959
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SpecFilePathSuffix
|
|
681
960
|
|
|
682
961
|
RSpec/StubbedMock:
|
|
683
962
|
Description: Checks that message expectations do not have a configured response.
|
|
684
963
|
Enabled: true
|
|
685
964
|
VersionAdded: '1.44'
|
|
686
|
-
|
|
965
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/StubbedMock
|
|
687
966
|
|
|
688
967
|
RSpec/SubjectDeclaration:
|
|
689
968
|
Description: Ensure that subject is defined using subject helper.
|
|
690
|
-
Enabled:
|
|
969
|
+
Enabled: true
|
|
691
970
|
VersionAdded: '2.5'
|
|
692
|
-
|
|
971
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SubjectDeclaration
|
|
693
972
|
|
|
694
973
|
RSpec/SubjectStub:
|
|
695
974
|
Description: Checks for stubbed test subjects.
|
|
696
975
|
Enabled: true
|
|
697
976
|
VersionAdded: '1.7'
|
|
698
|
-
|
|
977
|
+
VersionChanged: '2.8'
|
|
978
|
+
StyleGuide: https://rspec.rubystyle.guide/#dont-stub-subject
|
|
979
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SubjectStub
|
|
980
|
+
|
|
981
|
+
RSpec/UndescriptiveLiteralsDescription:
|
|
982
|
+
Description: Description should be descriptive.
|
|
983
|
+
Enabled: true
|
|
984
|
+
VersionAdded: '2.29'
|
|
985
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/UndescriptiveLiteralsDescription
|
|
699
986
|
|
|
700
987
|
RSpec/UnspecifiedException:
|
|
701
988
|
Description: Checks for a specified error in checking raised errors.
|
|
702
989
|
Enabled: true
|
|
703
990
|
VersionAdded: '1.30'
|
|
704
|
-
|
|
991
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/UnspecifiedException
|
|
705
992
|
|
|
706
993
|
RSpec/VariableDefinition:
|
|
707
994
|
Description: Checks that memoized helpers names are symbols or strings.
|
|
@@ -711,7 +998,7 @@ RSpec/VariableDefinition:
|
|
|
711
998
|
- symbols
|
|
712
999
|
- strings
|
|
713
1000
|
VersionAdded: '1.40'
|
|
714
|
-
|
|
1001
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableDefinition
|
|
715
1002
|
|
|
716
1003
|
RSpec/VariableName:
|
|
717
1004
|
Description: Checks that memoized helper names use the configured style.
|
|
@@ -722,8 +1009,16 @@ RSpec/VariableName:
|
|
|
722
1009
|
- camelCase
|
|
723
1010
|
AllowedPatterns: []
|
|
724
1011
|
VersionAdded: '1.40'
|
|
725
|
-
VersionChanged: '
|
|
726
|
-
|
|
1012
|
+
VersionChanged: '2.13'
|
|
1013
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableName
|
|
1014
|
+
|
|
1015
|
+
RSpec/VerifiedDoubleReference:
|
|
1016
|
+
Description: Checks for consistent verified double reference style.
|
|
1017
|
+
Enabled: true
|
|
1018
|
+
SafeAutoCorrect: false
|
|
1019
|
+
VersionAdded: 2.10.0
|
|
1020
|
+
VersionChanged: '3.4'
|
|
1021
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VerifiedDoubleReference
|
|
727
1022
|
|
|
728
1023
|
RSpec/VerifiedDoubles:
|
|
729
1024
|
Description: Prefer using verifying doubles over normal doubles.
|
|
@@ -732,46 +1027,37 @@ RSpec/VerifiedDoubles:
|
|
|
732
1027
|
IgnoreSymbolicNames: false
|
|
733
1028
|
VersionAdded: 1.2.1
|
|
734
1029
|
VersionChanged: '1.5'
|
|
735
|
-
StyleGuide: https://
|
|
1030
|
+
StyleGuide: https://rspec.rubystyle.guide/#doubles
|
|
1031
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VerifiedDoubles
|
|
736
1032
|
|
|
737
1033
|
RSpec/VoidExpect:
|
|
738
|
-
Description:
|
|
1034
|
+
Description: Checks void `expect()`.
|
|
739
1035
|
Enabled: true
|
|
740
1036
|
VersionAdded: '1.16'
|
|
741
|
-
|
|
1037
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VoidExpect
|
|
742
1038
|
|
|
743
1039
|
RSpec/Yield:
|
|
744
|
-
Description:
|
|
1040
|
+
Description: Checks for calling a block within a stub.
|
|
745
1041
|
Enabled: true
|
|
746
1042
|
VersionAdded: '1.32'
|
|
747
|
-
|
|
1043
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Yield
|
|
748
1044
|
|
|
749
|
-
|
|
1045
|
+
Capybara:
|
|
750
1046
|
Enabled: true
|
|
751
|
-
Include: *1
|
|
752
|
-
Language: *2
|
|
753
1047
|
|
|
754
1048
|
Capybara/CurrentPathExpectation:
|
|
755
1049
|
Description: Checks that no expectations are set on Capybara's `current_path`.
|
|
756
1050
|
Enabled: true
|
|
757
1051
|
VersionAdded: '1.18'
|
|
758
1052
|
VersionChanged: '2.0'
|
|
759
|
-
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/
|
|
760
|
-
|
|
761
|
-
RSpec/Capybara/FeatureMethods:
|
|
762
|
-
Description: Checks for consistent method usage in feature specs.
|
|
763
|
-
Enabled: true
|
|
764
|
-
EnabledMethods: []
|
|
765
|
-
VersionAdded: '1.17'
|
|
766
|
-
VersionChanged: '2.0'
|
|
767
|
-
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods
|
|
1053
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/Capybara/CurrentPathExpectation
|
|
768
1054
|
|
|
769
1055
|
Capybara/VisibilityMatcher:
|
|
770
1056
|
Description: Checks for boolean visibility in capybara finders.
|
|
771
1057
|
Enabled: true
|
|
772
1058
|
VersionAdded: '1.39'
|
|
773
1059
|
VersionChanged: '2.0'
|
|
774
|
-
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/
|
|
1060
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/Capybara/VisibilityMatcher
|
|
775
1061
|
|
|
776
1062
|
FactoryBot:
|
|
777
1063
|
Enabled: true
|
|
@@ -823,18 +1109,18 @@ FactoryBot/SyntaxMethods:
|
|
|
823
1109
|
VersionAdded: '2.7'
|
|
824
1110
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/SyntaxMethods
|
|
825
1111
|
|
|
826
|
-
|
|
1112
|
+
RSpecRails:
|
|
827
1113
|
Enabled: true
|
|
828
1114
|
Include: *1
|
|
829
1115
|
Language: *2
|
|
830
1116
|
|
|
831
|
-
|
|
1117
|
+
RSpecRails/AvoidSetupHook:
|
|
832
1118
|
Description: Checks that tests use RSpec `before` hook over Rails `setup` method.
|
|
833
1119
|
Enabled: pending
|
|
834
1120
|
VersionAdded: '2.4'
|
|
835
|
-
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/
|
|
1121
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpecRails/AvoidSetupHook
|
|
836
1122
|
|
|
837
|
-
|
|
1123
|
+
RSpecRails/HttpStatus:
|
|
838
1124
|
Description: Enforces use of symbolic or numeric value to describe HTTP status.
|
|
839
1125
|
Enabled: true
|
|
840
1126
|
EnforcedStyle: symbolic
|
|
@@ -843,4 +1129,4 @@ RSpec/Rails/HttpStatus:
|
|
|
843
1129
|
- symbolic
|
|
844
1130
|
VersionAdded: '1.23'
|
|
845
1131
|
VersionChanged: '2.0'
|
|
846
|
-
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/
|
|
1132
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpecRails/HttpStatus
|