standard-rspec 0.2.2 → 0.3.1
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 +411 -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,26 @@ 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/IndexedLet:
|
536
|
+
Description: Do not set up test data using indexes (e.g., `item_1`, `item_2`).
|
537
|
+
Enabled: true
|
538
|
+
VersionAdded: '2.20'
|
539
|
+
VersionChanged: '2.23'
|
540
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IndexedLet
|
541
|
+
Max: 1
|
542
|
+
AllowedIdentifiers: []
|
543
|
+
AllowedPatterns: []
|
429
544
|
|
430
545
|
RSpec/InstanceSpy:
|
431
546
|
Description: Checks for `instance_double` used with `have_received`.
|
432
547
|
Enabled: true
|
433
548
|
VersionAdded: '1.12'
|
434
|
-
|
549
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceSpy
|
435
550
|
|
436
551
|
RSpec/InstanceVariable:
|
437
552
|
Description: Checks for instance variable usage in specs.
|
@@ -439,7 +554,15 @@ RSpec/InstanceVariable:
|
|
439
554
|
AssignmentOnly: false
|
440
555
|
VersionAdded: '1.0'
|
441
556
|
VersionChanged: '1.7'
|
442
|
-
StyleGuide: https://
|
557
|
+
StyleGuide: https://rspec.rubystyle.guide/#instance-variables
|
558
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable
|
559
|
+
|
560
|
+
RSpec/IsExpectedSpecify:
|
561
|
+
Description: Check for `specify` with `is_expected` and one-liner expectations.
|
562
|
+
Enabled: true
|
563
|
+
VersionAdded: '2.27'
|
564
|
+
StyleGuide: https://rspec.rubystyle.guide/#it-and-specify
|
565
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IsExpectedSpecify
|
443
566
|
|
444
567
|
RSpec/ItBehavesLike:
|
445
568
|
Description: Checks that only one `it_behaves_like` style is used.
|
@@ -449,45 +572,54 @@ RSpec/ItBehavesLike:
|
|
449
572
|
- it_behaves_like
|
450
573
|
- it_should_behave_like
|
451
574
|
VersionAdded: '1.13'
|
452
|
-
|
575
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ItBehavesLike
|
453
576
|
|
454
577
|
RSpec/IteratedExpectation:
|
455
578
|
Description: Check that `all` matcher is used instead of iterating over an array.
|
456
579
|
Enabled: true
|
457
580
|
VersionAdded: '1.14'
|
458
|
-
|
581
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IteratedExpectation
|
459
582
|
|
460
583
|
RSpec/LeadingSubject:
|
461
584
|
Description: Enforce that subject is the first definition in the test.
|
462
585
|
Enabled: true
|
463
586
|
VersionAdded: '1.7'
|
464
587
|
VersionChanged: '1.14'
|
465
|
-
StyleGuide: https://
|
588
|
+
StyleGuide: https://rspec.rubystyle.guide/#leading-subject
|
589
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LeadingSubject
|
466
590
|
|
467
591
|
RSpec/LeakyConstantDeclaration:
|
468
592
|
Description: Checks that no class, module, or constant is declared.
|
469
593
|
Enabled: true
|
470
594
|
VersionAdded: '1.35'
|
471
|
-
StyleGuide: https://
|
595
|
+
StyleGuide: https://rspec.rubystyle.guide/#declare-constants
|
596
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LeakyConstantDeclaration
|
472
597
|
|
473
598
|
RSpec/LetBeforeExamples:
|
474
599
|
Description: Checks for `let` definitions that come after an example.
|
475
600
|
Enabled: true
|
601
|
+
AutoCorrect: contextual
|
476
602
|
VersionAdded: '1.16'
|
477
|
-
VersionChanged: '
|
478
|
-
|
603
|
+
VersionChanged: '2.31'
|
604
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetBeforeExamples
|
479
605
|
|
480
606
|
RSpec/LetSetup:
|
481
607
|
Description: Checks unreferenced `let!` calls being used for test setup.
|
482
608
|
Enabled: true
|
483
609
|
VersionAdded: '1.7'
|
484
|
-
|
610
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetSetup
|
611
|
+
|
612
|
+
RSpec/MatchArray:
|
613
|
+
Description: Checks where `match_array` is used.
|
614
|
+
Enabled: true
|
615
|
+
VersionAdded: '2.19'
|
616
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MatchArray
|
485
617
|
|
486
618
|
RSpec/MessageChain:
|
487
619
|
Description: Check that chains of messages are not being stubbed.
|
488
620
|
Enabled: true
|
489
621
|
VersionAdded: '1.7'
|
490
|
-
|
622
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageChain
|
491
623
|
|
492
624
|
RSpec/MessageExpectation:
|
493
625
|
Description: Checks for consistent message expectation style.
|
@@ -498,7 +630,7 @@ RSpec/MessageExpectation:
|
|
498
630
|
- expect
|
499
631
|
VersionAdded: '1.7'
|
500
632
|
VersionChanged: '1.8'
|
501
|
-
|
633
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageExpectation
|
502
634
|
|
503
635
|
RSpec/MessageSpies:
|
504
636
|
Description: Checks that message expectations are set using spies.
|
@@ -508,19 +640,35 @@ RSpec/MessageSpies:
|
|
508
640
|
- have_received
|
509
641
|
- receive
|
510
642
|
VersionAdded: '1.9'
|
511
|
-
|
643
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies
|
644
|
+
|
645
|
+
RSpec/MetadataStyle:
|
646
|
+
Description: Use consistent metadata style.
|
647
|
+
Enabled: true
|
648
|
+
EnforcedStyle: symbol
|
649
|
+
SupportedStyles:
|
650
|
+
- hash
|
651
|
+
- symbol
|
652
|
+
VersionAdded: '2.24'
|
653
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MetadataStyle
|
512
654
|
|
513
655
|
RSpec/MissingExampleGroupArgument:
|
514
656
|
Description: Checks that the first argument to an example group is not empty.
|
515
657
|
Enabled: true
|
516
658
|
VersionAdded: '1.28'
|
517
|
-
|
659
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExampleGroupArgument
|
660
|
+
|
661
|
+
RSpec/MissingExpectationTargetMethod:
|
662
|
+
Description: Checks if `.to`, `not_to` or `to_not` are used.
|
663
|
+
Enabled: true
|
664
|
+
VersionAdded: '3.0'
|
665
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExpectationTargetMethod
|
518
666
|
|
519
667
|
RSpec/MultipleDescribes:
|
520
668
|
Description: Checks for multiple top-level example groups.
|
521
669
|
Enabled: true
|
522
670
|
VersionAdded: '1.0'
|
523
|
-
|
671
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleDescribes
|
524
672
|
|
525
673
|
RSpec/MultipleExpectations:
|
526
674
|
Description: Checks if examples contain too many `expect` calls.
|
@@ -528,7 +676,8 @@ RSpec/MultipleExpectations:
|
|
528
676
|
Max: 1
|
529
677
|
VersionAdded: '1.7'
|
530
678
|
VersionChanged: '1.21'
|
531
|
-
StyleGuide: https://
|
679
|
+
StyleGuide: https://rspec.rubystyle.guide/#expectation-per-example
|
680
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleExpectations
|
532
681
|
|
533
682
|
RSpec/MultipleMemoizedHelpers:
|
534
683
|
Description: Checks if example groups contain too many `let` and `subject` calls.
|
@@ -536,28 +685,47 @@ RSpec/MultipleMemoizedHelpers:
|
|
536
685
|
AllowSubject: true
|
537
686
|
Max: 5
|
538
687
|
VersionAdded: '1.43'
|
539
|
-
StyleGuide: https://
|
688
|
+
StyleGuide: https://rspec.rubystyle.guide/#let-blocks
|
689
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleMemoizedHelpers
|
540
690
|
|
541
691
|
RSpec/MultipleSubjects:
|
542
692
|
Description: Checks if an example group defines `subject` multiple times.
|
543
693
|
Enabled: true
|
544
694
|
VersionAdded: '1.16'
|
545
|
-
|
695
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleSubjects
|
546
696
|
|
547
697
|
RSpec/NamedSubject:
|
548
698
|
Description: Checks for explicitly referenced test subjects.
|
549
699
|
Enabled: true
|
700
|
+
EnforcedStyle: always
|
701
|
+
SupportedStyles:
|
702
|
+
- always
|
703
|
+
- named_only
|
550
704
|
IgnoreSharedExamples: true
|
551
705
|
VersionAdded: 1.5.3
|
552
|
-
|
706
|
+
VersionChanged: '2.15'
|
707
|
+
StyleGuide: https://rspec.rubystyle.guide/#use-subject
|
708
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NamedSubject
|
553
709
|
|
554
710
|
RSpec/NestedGroups:
|
555
711
|
Description: Checks for nested example groups.
|
556
712
|
Enabled: true
|
557
713
|
Max: 3
|
714
|
+
AllowedGroups: []
|
558
715
|
VersionAdded: '1.7'
|
559
|
-
VersionChanged: '
|
560
|
-
|
716
|
+
VersionChanged: '2.13'
|
717
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups
|
718
|
+
|
719
|
+
RSpec/NoExpectationExample:
|
720
|
+
Description: Checks if an example contains any expectation.
|
721
|
+
Enabled: true
|
722
|
+
Safe: false
|
723
|
+
VersionAdded: '2.13'
|
724
|
+
VersionChanged: '2.14'
|
725
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NoExpectationExample
|
726
|
+
AllowedPatterns:
|
727
|
+
- "^expect_"
|
728
|
+
- "^assert_"
|
561
729
|
|
562
730
|
RSpec/NotToNot:
|
563
731
|
Description: Checks for consistent method usage for negating expectations.
|
@@ -567,19 +735,25 @@ RSpec/NotToNot:
|
|
567
735
|
- not_to
|
568
736
|
- to_not
|
569
737
|
VersionAdded: '1.4'
|
570
|
-
|
738
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
|
571
739
|
|
572
740
|
RSpec/OverwritingSetup:
|
573
741
|
Description: Checks if there is a let/subject that overwrites an existing one.
|
574
742
|
Enabled: true
|
575
743
|
VersionAdded: '1.14'
|
576
|
-
|
744
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/OverwritingSetup
|
577
745
|
|
578
746
|
RSpec/Pending:
|
579
747
|
Description: Checks for any pending or skipped examples.
|
580
748
|
Enabled: false
|
581
749
|
VersionAdded: '1.25'
|
582
|
-
|
750
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Pending
|
751
|
+
|
752
|
+
RSpec/PendingWithoutReason:
|
753
|
+
Description: Checks for pending or skipped examples without reason.
|
754
|
+
Enabled: true
|
755
|
+
VersionAdded: '2.16'
|
756
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PendingWithoutReason
|
583
757
|
|
584
758
|
RSpec/PredicateMatcher:
|
585
759
|
Description: Prefer using predicate matcher over using predicate method directly.
|
@@ -592,49 +766,81 @@ RSpec/PredicateMatcher:
|
|
592
766
|
- explicit
|
593
767
|
SafeAutoCorrect: false
|
594
768
|
VersionAdded: '1.16'
|
595
|
-
StyleGuide: https://
|
769
|
+
StyleGuide: https://rspec.rubystyle.guide/#predicate-matchers
|
770
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PredicateMatcher
|
596
771
|
|
597
772
|
RSpec/ReceiveCounts:
|
598
773
|
Description: Check for `once` and `twice` receive counts matchers usage.
|
599
774
|
Enabled: true
|
600
775
|
VersionAdded: '1.26'
|
601
|
-
|
776
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveCounts
|
777
|
+
|
778
|
+
RSpec/ReceiveMessages:
|
779
|
+
Description: Checks for multiple messages stubbed on the same object.
|
780
|
+
Enabled: true
|
781
|
+
SafeAutoCorrect: false
|
782
|
+
VersionAdded: '2.23'
|
783
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveMessages
|
602
784
|
|
603
785
|
RSpec/ReceiveNever:
|
604
786
|
Description: Prefer `not_to receive(...)` over `receive(...).never`.
|
605
787
|
Enabled: true
|
606
788
|
VersionAdded: '1.28'
|
607
|
-
|
789
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveNever
|
790
|
+
|
791
|
+
RSpec/RedundantAround:
|
792
|
+
Description: Remove redundant `around` hook.
|
793
|
+
Enabled: true
|
794
|
+
VersionAdded: '2.19'
|
795
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RedundantAround
|
796
|
+
|
797
|
+
RSpec/RedundantPredicateMatcher:
|
798
|
+
Description: Checks for redundant predicate matcher.
|
799
|
+
Enabled: true
|
800
|
+
VersionAdded: '2.26'
|
801
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RedundantPredicateMatcher
|
802
|
+
|
803
|
+
RSpec/RemoveConst:
|
804
|
+
Description: Checks that `remove_const` is not used in specs.
|
805
|
+
Enabled: true
|
806
|
+
VersionAdded: '2.26'
|
807
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RemoveConst
|
608
808
|
|
609
809
|
RSpec/RepeatedDescription:
|
610
810
|
Description: Check for repeated description strings in example groups.
|
611
811
|
Enabled: true
|
612
812
|
VersionAdded: '1.9'
|
613
|
-
|
813
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription
|
614
814
|
|
615
815
|
RSpec/RepeatedExample:
|
616
816
|
Description: Check for repeated examples within example groups.
|
617
817
|
Enabled: true
|
618
818
|
VersionAdded: '1.10'
|
619
|
-
|
819
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample
|
620
820
|
|
621
821
|
RSpec/RepeatedExampleGroupBody:
|
622
822
|
Description: Check for repeated describe and context block body.
|
623
823
|
Enabled: true
|
624
824
|
VersionAdded: '1.38'
|
625
|
-
|
825
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExampleGroupBody
|
626
826
|
|
627
827
|
RSpec/RepeatedExampleGroupDescription:
|
628
828
|
Description: Check for repeated example group descriptions.
|
629
829
|
Enabled: true
|
630
830
|
VersionAdded: '1.38'
|
631
|
-
|
831
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExampleGroupDescription
|
632
832
|
|
633
833
|
RSpec/RepeatedIncludeExample:
|
634
834
|
Description: Check for repeated include of shared examples.
|
635
835
|
Enabled: true
|
636
836
|
VersionAdded: '1.44'
|
637
|
-
|
837
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedIncludeExample
|
838
|
+
|
839
|
+
RSpec/RepeatedSubjectCall:
|
840
|
+
Description: Checks for repeated calls to subject missing that it is memoized.
|
841
|
+
Enabled: true
|
842
|
+
VersionAdded: '2.27'
|
843
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedSubjectCall
|
638
844
|
|
639
845
|
RSpec/ReturnFromStub:
|
640
846
|
Description: Checks for consistent style of stub's return setting.
|
@@ -645,63 +851,116 @@ RSpec/ReturnFromStub:
|
|
645
851
|
- block
|
646
852
|
VersionAdded: '1.16'
|
647
853
|
VersionChanged: '1.22'
|
648
|
-
|
854
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReturnFromStub
|
649
855
|
|
650
856
|
RSpec/ScatteredLet:
|
651
857
|
Description: Checks for let scattered across the example group.
|
652
858
|
Enabled: true
|
859
|
+
AutoCorrect: contextual
|
653
860
|
VersionAdded: '1.14'
|
654
|
-
VersionChanged: '
|
655
|
-
|
861
|
+
VersionChanged: '2.31'
|
862
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredLet
|
656
863
|
|
657
864
|
RSpec/ScatteredSetup:
|
658
865
|
Description: Checks for setup scattered across multiple hooks in an example group.
|
659
866
|
Enabled: true
|
867
|
+
AutoCorrect: contextual
|
660
868
|
VersionAdded: '1.10'
|
661
|
-
|
869
|
+
VersionChanged: '2.31'
|
870
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredSetup
|
662
871
|
|
663
872
|
RSpec/SharedContext:
|
664
873
|
Description: Checks for proper shared_context and shared_examples usage.
|
665
874
|
Enabled: true
|
666
875
|
VersionAdded: '1.13'
|
667
|
-
|
876
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedContext
|
668
877
|
|
669
878
|
RSpec/SharedExamples:
|
670
|
-
Description:
|
879
|
+
Description: Checks for consistent style for shared example names.
|
671
880
|
Enabled: true
|
881
|
+
EnforcedStyle: string
|
882
|
+
SupportedStyles:
|
883
|
+
- string
|
884
|
+
- symbol
|
672
885
|
VersionAdded: '1.25'
|
673
|
-
|
886
|
+
VersionChanged: '2.26'
|
887
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedExamples
|
674
888
|
|
675
889
|
RSpec/SingleArgumentMessageChain:
|
676
890
|
Description: Checks that chains of messages contain more than one element.
|
677
891
|
Enabled: true
|
678
892
|
VersionAdded: '1.9'
|
679
893
|
VersionChanged: '1.10'
|
680
|
-
|
894
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SingleArgumentMessageChain
|
895
|
+
|
896
|
+
RSpec/SkipBlockInsideExample:
|
897
|
+
Description: Checks for passing a block to `skip` within examples.
|
898
|
+
Enabled: true
|
899
|
+
VersionAdded: '2.19'
|
900
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SkipBlockInsideExample
|
901
|
+
|
902
|
+
RSpec/SortMetadata:
|
903
|
+
Description: Sort RSpec metadata alphabetically.
|
904
|
+
Enabled: true
|
905
|
+
VersionAdded: '2.14'
|
906
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SortMetadata
|
907
|
+
|
908
|
+
RSpec/SpecFilePathFormat:
|
909
|
+
Description: Checks that spec file paths are consistent and well-formed.
|
910
|
+
Enabled: true
|
911
|
+
Include:
|
912
|
+
- "**/*_spec.rb"
|
913
|
+
Exclude:
|
914
|
+
- "**/spec/routing/**/*"
|
915
|
+
CustomTransform:
|
916
|
+
RuboCop: rubocop
|
917
|
+
RSpec: rspec
|
918
|
+
IgnoreMethods: false
|
919
|
+
IgnoreMetadata:
|
920
|
+
type: routing
|
921
|
+
VersionAdded: '2.24'
|
922
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SpecFilePathFormat
|
923
|
+
|
924
|
+
RSpec/SpecFilePathSuffix:
|
925
|
+
Description: Checks that spec file paths suffix are consistent and well-formed.
|
926
|
+
Enabled: true
|
927
|
+
VersionAdded: '2.24'
|
928
|
+
Include:
|
929
|
+
- "**/*_spec*rb*"
|
930
|
+
- "**/spec/**/*"
|
931
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SpecFilePathSuffix
|
681
932
|
|
682
933
|
RSpec/StubbedMock:
|
683
934
|
Description: Checks that message expectations do not have a configured response.
|
684
935
|
Enabled: true
|
685
936
|
VersionAdded: '1.44'
|
686
|
-
|
937
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/StubbedMock
|
687
938
|
|
688
939
|
RSpec/SubjectDeclaration:
|
689
940
|
Description: Ensure that subject is defined using subject helper.
|
690
|
-
Enabled:
|
941
|
+
Enabled: true
|
691
942
|
VersionAdded: '2.5'
|
692
|
-
|
943
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SubjectDeclaration
|
693
944
|
|
694
945
|
RSpec/SubjectStub:
|
695
946
|
Description: Checks for stubbed test subjects.
|
696
947
|
Enabled: true
|
697
948
|
VersionAdded: '1.7'
|
698
|
-
|
949
|
+
VersionChanged: '2.8'
|
950
|
+
StyleGuide: https://rspec.rubystyle.guide/#dont-stub-subject
|
951
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SubjectStub
|
952
|
+
|
953
|
+
RSpec/UndescriptiveLiteralsDescription:
|
954
|
+
Description: Description should be descriptive.
|
955
|
+
Enabled: true
|
956
|
+
VersionAdded: '2.29'
|
957
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/UndescriptiveLiteralsDescription
|
699
958
|
|
700
959
|
RSpec/UnspecifiedException:
|
701
960
|
Description: Checks for a specified error in checking raised errors.
|
702
961
|
Enabled: true
|
703
962
|
VersionAdded: '1.30'
|
704
|
-
|
963
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/UnspecifiedException
|
705
964
|
|
706
965
|
RSpec/VariableDefinition:
|
707
966
|
Description: Checks that memoized helpers names are symbols or strings.
|
@@ -711,7 +970,7 @@ RSpec/VariableDefinition:
|
|
711
970
|
- symbols
|
712
971
|
- strings
|
713
972
|
VersionAdded: '1.40'
|
714
|
-
|
973
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableDefinition
|
715
974
|
|
716
975
|
RSpec/VariableName:
|
717
976
|
Description: Checks that memoized helper names use the configured style.
|
@@ -722,8 +981,16 @@ RSpec/VariableName:
|
|
722
981
|
- camelCase
|
723
982
|
AllowedPatterns: []
|
724
983
|
VersionAdded: '1.40'
|
725
|
-
VersionChanged: '
|
726
|
-
|
984
|
+
VersionChanged: '2.13'
|
985
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableName
|
986
|
+
|
987
|
+
RSpec/VerifiedDoubleReference:
|
988
|
+
Description: Checks for consistent verified double reference style.
|
989
|
+
Enabled: true
|
990
|
+
SafeAutoCorrect: false
|
991
|
+
VersionAdded: 2.10.0
|
992
|
+
VersionChanged: '3.4'
|
993
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VerifiedDoubleReference
|
727
994
|
|
728
995
|
RSpec/VerifiedDoubles:
|
729
996
|
Description: Prefer using verifying doubles over normal doubles.
|
@@ -732,46 +999,37 @@ RSpec/VerifiedDoubles:
|
|
732
999
|
IgnoreSymbolicNames: false
|
733
1000
|
VersionAdded: 1.2.1
|
734
1001
|
VersionChanged: '1.5'
|
735
|
-
StyleGuide: https://
|
1002
|
+
StyleGuide: https://rspec.rubystyle.guide/#doubles
|
1003
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VerifiedDoubles
|
736
1004
|
|
737
1005
|
RSpec/VoidExpect:
|
738
|
-
Description:
|
1006
|
+
Description: Checks void `expect()`.
|
739
1007
|
Enabled: true
|
740
1008
|
VersionAdded: '1.16'
|
741
|
-
|
1009
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VoidExpect
|
742
1010
|
|
743
1011
|
RSpec/Yield:
|
744
|
-
Description:
|
1012
|
+
Description: Checks for calling a block within a stub.
|
745
1013
|
Enabled: true
|
746
1014
|
VersionAdded: '1.32'
|
747
|
-
|
1015
|
+
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Yield
|
748
1016
|
|
749
|
-
|
1017
|
+
Capybara:
|
750
1018
|
Enabled: true
|
751
|
-
Include: *1
|
752
|
-
Language: *2
|
753
1019
|
|
754
1020
|
Capybara/CurrentPathExpectation:
|
755
1021
|
Description: Checks that no expectations are set on Capybara's `current_path`.
|
756
1022
|
Enabled: true
|
757
1023
|
VersionAdded: '1.18'
|
758
1024
|
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
|
1025
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/Capybara/CurrentPathExpectation
|
768
1026
|
|
769
1027
|
Capybara/VisibilityMatcher:
|
770
1028
|
Description: Checks for boolean visibility in capybara finders.
|
771
1029
|
Enabled: true
|
772
1030
|
VersionAdded: '1.39'
|
773
1031
|
VersionChanged: '2.0'
|
774
|
-
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/
|
1032
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/Capybara/VisibilityMatcher
|
775
1033
|
|
776
1034
|
FactoryBot:
|
777
1035
|
Enabled: true
|
@@ -823,18 +1081,18 @@ FactoryBot/SyntaxMethods:
|
|
823
1081
|
VersionAdded: '2.7'
|
824
1082
|
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/SyntaxMethods
|
825
1083
|
|
826
|
-
|
1084
|
+
RSpecRails:
|
827
1085
|
Enabled: true
|
828
1086
|
Include: *1
|
829
1087
|
Language: *2
|
830
1088
|
|
831
|
-
|
1089
|
+
RSpecRails/AvoidSetupHook:
|
832
1090
|
Description: Checks that tests use RSpec `before` hook over Rails `setup` method.
|
833
1091
|
Enabled: pending
|
834
1092
|
VersionAdded: '2.4'
|
835
|
-
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/
|
1093
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpecRails/AvoidSetupHook
|
836
1094
|
|
837
|
-
|
1095
|
+
RSpecRails/HttpStatus:
|
838
1096
|
Description: Enforces use of symbolic or numeric value to describe HTTP status.
|
839
1097
|
Enabled: true
|
840
1098
|
EnforcedStyle: symbolic
|
@@ -843,4 +1101,4 @@ RSpec/Rails/HttpStatus:
|
|
843
1101
|
- symbolic
|
844
1102
|
VersionAdded: '1.23'
|
845
1103
|
VersionChanged: '2.0'
|
846
|
-
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/
|
1104
|
+
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpecRails/HttpStatus
|