rubocop-rspec 2.29.2 → 3.0.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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/README.md +1 -1
  4. data/config/default.yml +62 -264
  5. data/config/obsoletion.yml +11 -0
  6. data/lib/rubocop/cop/rspec/base.rb +0 -1
  7. data/lib/rubocop/cop/rspec/dialect.rb +13 -0
  8. data/lib/rubocop/cop/rspec/expect_actual.rb +1 -1
  9. data/lib/rubocop/cop/rspec/expect_in_hook.rb +1 -1
  10. data/lib/rubocop/cop/rspec/expect_in_let.rb +42 -0
  11. data/lib/rubocop/cop/rspec/leaky_constant_declaration.rb +1 -1
  12. data/lib/rubocop/cop/rspec/missing_expectation_target_method.rb +54 -0
  13. data/lib/rubocop/cop/rspec/multiple_describes.rb +1 -1
  14. data/lib/rubocop/cop/rspec/multiple_expectations.rb +2 -2
  15. data/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb +2 -4
  16. data/lib/rubocop/cop/rspec/named_subject.rb +5 -2
  17. data/lib/rubocop/cop/rspec/predicate_matcher.rb +1 -1
  18. data/lib/rubocop/cop/rspec/remove_const.rb +0 -1
  19. data/lib/rubocop/cop/rspec/scattered_setup.rb +1 -1
  20. data/lib/rubocop/cop/rspec/sort_metadata.rb +1 -1
  21. data/lib/rubocop/cop/rspec/stubbed_mock.rb +3 -1
  22. data/lib/rubocop/cop/rspec/subject_stub.rb +2 -2
  23. data/lib/rubocop/cop/rspec_cops.rb +2 -25
  24. data/lib/rubocop/rspec/concept.rb +0 -1
  25. data/lib/rubocop/rspec/config_formatter.rb +1 -24
  26. data/lib/rubocop/rspec/cop/generator.rb +25 -0
  27. data/lib/rubocop/rspec/language.rb +0 -1
  28. data/lib/rubocop/rspec/shared_contexts/default_rspec_language_config_context.rb +1 -1
  29. data/lib/rubocop/rspec/version.rb +1 -1
  30. data/lib/rubocop-rspec.rb +1 -17
  31. metadata +7 -69
  32. data/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb +0 -39
  33. data/lib/rubocop/cop/rspec/capybara/feature_methods.rb +0 -104
  34. data/lib/rubocop/cop/rspec/capybara/match_style.rb +0 -38
  35. data/lib/rubocop/cop/rspec/capybara/negation_matcher.rb +0 -33
  36. data/lib/rubocop/cop/rspec/capybara/specific_actions.rb +0 -29
  37. data/lib/rubocop/cop/rspec/capybara/specific_finders.rb +0 -24
  38. data/lib/rubocop/cop/rspec/capybara/specific_matcher.rb +0 -35
  39. data/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb +0 -36
  40. data/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb +0 -35
  41. data/lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb +0 -50
  42. data/lib/rubocop/cop/rspec/factory_bot/create_list.rb +0 -40
  43. data/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb +0 -29
  44. data/lib/rubocop/cop/rspec/factory_bot/factory_name_style.rb +0 -33
  45. data/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb +0 -55
  46. data/lib/rubocop/cop/rspec/file_path.rb +0 -179
  47. data/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb +0 -27
  48. data/lib/rubocop/cop/rspec/rails/have_http_status.rb +0 -35
  49. data/lib/rubocop/cop/rspec/rails/http_status.rb +0 -61
  50. data/lib/rubocop/cop/rspec/rails/inferred_spec_type.rb +0 -62
  51. data/lib/rubocop/cop/rspec/rails/minitest_assertions.rb +0 -39
  52. data/lib/rubocop/cop/rspec/rails/negation_be_valid.rb +0 -39
  53. data/lib/rubocop/cop/rspec/rails/travel_around.rb +0 -34
  54. data/lib/rubocop/rspec/language/node_pattern.rb +0 -48
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f4865ebd50bfe7df9833f2c5321a46dcac8631087062605b7e077e6b633099a
4
- data.tar.gz: 4520e7bdaae0270de34922c53f08d23679b9ac66a89bad29a52485bcdc49432d
3
+ metadata.gz: b642c03d2fb24a8ac19e4e9ea60b7db9267550533be56cf6bb01b79724f7ec5f
4
+ data.tar.gz: 560dcc8a649c9556ea38021addb497c188eeb794432e307c13203bfe0d8d3d56
5
5
  SHA512:
6
- metadata.gz: 202e33ab3927087a3e59917c1a73edc28f13054e668bbefeb5451799f373304b0a5d703e3a0564cf72df2f8afe86d0be1b5a1ffc06bfe2f145c4b2645474a653
7
- data.tar.gz: ad0cb220b35590ffc7911e149d9754af5185b83fe597a2212a4dca2927617f4269af80f19cfeabd147e2b06181c9ce37a44998822d9a3f2fd7c27395fca18b0d
6
+ metadata.gz: 58f1eeb3b7a5c23629f76b87a4d1f66f1654bede0b59a4b8f9d7636f78d845850bf7518d87fac5a6daea2dda7bd13f844c59954ef231ce99a7cf310816891009
7
+ data.tar.gz: 4646cb7db9590720e985fa24b7cec2908af6b0a5c4ae61b882587f189f95b705dbf8f0272d7d30f2d0af569e4ec8d2cee9a20ba8ada819c3948c6a29dd6b3962
data/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  ## Master (Unreleased)
4
4
 
5
+ ## 3.0.1 (2024-06-11)
6
+
7
+ - Bump RuboCop requirement to +1.61. ([@ydah])
8
+
9
+ ## 3.0.0 (2024-06-11)
10
+
11
+ - Remove extracted cops in `Capybara`, `FactoryBot` and `Rails` departments. ([@ydah])
12
+ - Remove `RuboCop::RSpec::Language::NodePattern`. ([@ydah])
13
+ - Remove `RSpec/FilePath` cop. ([@ydah])
14
+ - Remove `RSpec/Capybara/FeatureMethods` cop. If you are using this cop, change it to use `RSpec/Dialect`. ([@ydah])
15
+ - Add new `RSpec/MissingExpectationTargetMethod` cop. ([@krororo])
16
+ - Fix an error for `RSpec/ScatteredSetup` when one of the hooks is an empty block. ([@earlopain])
17
+
18
+ These previously pending cops are now enabled by default: `RSpec/BeEmpty`, `RSpec/BeEq`, `RSpec/BeNil`, `RSpec/ChangeByZero`, `RSpec/ClassCheck`, `RSpec/ContainExactly`, `RSpec/DuplicatedMetadata`, `RSpec/EmptyMetadata`, `RSpec/EmptyOutput`, `RSpec/Eq`, `RSpec/ExcessiveDocstringSpacing`, `RSpec/ExpectInLet`, `RSpec/IdenticalEqualityAssertion`, `RSpec/IndexedLet`, `RSpec/IsExpectedSpecify`, `RSpec/MatchArray`, `RSpec/MetadataStyle`, `RSpec/NoExpectationExample`, `RSpec/PendingWithoutReason`, `RSpec/ReceiveMessages`, `RSpec/RedundantAround`, `RSpec/RedundantPredicateMatcher`, `RSpec/RemoveConst`, `RSpec/RepeatedSubjectCall`, `RSpec/SkipBlockInsideExample`, `RSpec/SortMetadata`, `RSpec/SpecFilePathFormat`, `RSpec/SpecFilePathSuffix`, `RSpec/SubjectDeclaration`, `RSpec/UndescriptiveLiteralsDescription`, and `RSpec/VerifiedDoubleReference`.
19
+
20
+ Read more about how to upgrade in https://docs.rubocop.org/rubocop-rspec/upgrade_to_version_3.html
21
+
22
+ ## 2.31.0 (2024-06-07)
23
+
24
+ - Support `AutoCorrect: contextual` option for LSP. ([@ydah])
25
+
26
+ ## 2.30.0 (2024-06-03)
27
+
28
+ - Add new `RSpec/ExpectInLet` cop. ([@yasu551])
29
+
5
30
  ## 2.29.2 (2024-05-02)
6
31
 
7
32
  - Fix beginless and endless range bug for RepeatedIncludeExample cop. ([@hasghari])
@@ -885,6 +910,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
885
910
  [@drowze]: https://github.com/Drowze
886
911
  [@dswij]: https://github.com/dswij
887
912
  [@dvandersluis]: https://github.com/dvandersluis
913
+ [@earlopain]: https://github.com/earlopain
888
914
  [@edgibbs]: https://github.com/edgibbs
889
915
  [@eikes]: https://github.com/eikes
890
916
  [@eitoball]: https://github.com/eitoball
@@ -916,6 +942,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
916
942
  [@k-s-a]: https://github.com/K-S-A
917
943
  [@kellysutton]: https://github.com/kellysutton
918
944
  [@koic]: https://github.com/koic
945
+ [@krororo]: https://github.com/krororo
919
946
  [@kuahyeow]: https://github.com/kuahyeow
920
947
  [@lazycoder9]: https://github.com/lazycoder9
921
948
  [@leoarnold]: https://github.com/leoarnold
@@ -976,6 +1003,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
976
1003
  [@twalpole]: https://github.com/twalpole
977
1004
  [@vzvu3k6k]: https://github.com/vzvu3k6k
978
1005
  [@walf443]: https://github.com/walf443
1006
+ [@yasu551]: https://github.com/yasu551
979
1007
  [@ybiquitous]: https://github.com/ybiquitous
980
1008
  [@ydah]: https://github.com/ydah
981
1009
  [@yevhene]: https://github.com/yevhene
data/README.md CHANGED
@@ -81,7 +81,7 @@ In your `.rubocop.yml`, you may treat the RSpec cops just like any other
81
81
  cop. For example:
82
82
 
83
83
  ```yaml
84
- RSpec/FilePath:
84
+ RSpec/SpecFilePathFormat:
85
85
  Exclude:
86
86
  - spec/my_poorly_named_spec_file.rb
87
87
  ```
data/config/default.yml CHANGED
@@ -3,10 +3,10 @@ RSpec:
3
3
  Enabled: true
4
4
  StyleGuideBaseURL: https://rspec.rubystyle.guide
5
5
  DocumentationBaseURL: https://docs.rubocop.org/rubocop-rspec
6
- Include: &1
6
+ Include:
7
7
  - "**/*_spec.rb"
8
8
  - "**/spec/**/*"
9
- Language: &2
9
+ Language:
10
10
  inherit_mode:
11
11
  merge:
12
12
  - Expectations
@@ -146,13 +146,15 @@ RSpec/Be:
146
146
 
147
147
  RSpec/BeEmpty:
148
148
  Description: Prefer using `be_empty` when checking for an empty array.
149
- Enabled: pending
149
+ Enabled: true
150
+ AutoCorrect: contextual
150
151
  VersionAdded: '2.20'
152
+ VersionChanged: '2.31'
151
153
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEmpty
152
154
 
153
155
  RSpec/BeEq:
154
156
  Description: Check for expectations where `be(...)` can replace `eq(...)`.
155
- Enabled: pending
157
+ Enabled: true
156
158
  Safe: false
157
159
  VersionAdded: 2.9.0
158
160
  VersionChanged: '2.16'
@@ -168,7 +170,7 @@ RSpec/BeEql:
168
170
 
169
171
  RSpec/BeNil:
170
172
  Description: Ensures a consistent style is used when matching `nil`.
171
- Enabled: pending
173
+ Enabled: true
172
174
  EnforcedStyle: be_nil
173
175
  SupportedStyles:
174
176
  - be
@@ -191,7 +193,7 @@ RSpec/BeforeAfterAll:
191
193
 
192
194
  RSpec/ChangeByZero:
193
195
  Description: Prefer negated matchers over `to change.by(0)`.
194
- Enabled: pending
196
+ Enabled: true
195
197
  VersionAdded: '2.11'
196
198
  VersionChanged: '2.14'
197
199
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ChangeByZero
@@ -200,7 +202,7 @@ RSpec/ChangeByZero:
200
202
  RSpec/ClassCheck:
201
203
  Description: Enforces consistent use of `be_a` or `be_kind_of`.
202
204
  StyleGuide: "#is-a-vs-kind-of"
203
- Enabled: pending
205
+ Enabled: true
204
206
  VersionAdded: '2.13'
205
207
  EnforcedStyle: be_a
206
208
  SupportedStyles:
@@ -210,7 +212,7 @@ RSpec/ClassCheck:
210
212
 
211
213
  RSpec/ContainExactly:
212
214
  Description: Checks where `contain_exactly` is used.
213
- Enabled: pending
215
+ Enabled: true
214
216
  VersionAdded: '2.19'
215
217
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContainExactly
216
218
 
@@ -304,22 +306,25 @@ RSpec/Dialect:
304
306
 
305
307
  RSpec/DuplicatedMetadata:
306
308
  Description: Avoid duplicated metadata.
307
- Enabled: pending
309
+ Enabled: true
308
310
  VersionAdded: '2.16'
309
311
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DuplicatedMetadata
310
312
 
311
313
  RSpec/EmptyExampleGroup:
312
314
  Description: Checks if an example group does not include any tests.
313
315
  Enabled: true
316
+ AutoCorrect: contextual
314
317
  SafeAutoCorrect: false
315
318
  VersionAdded: '1.7'
316
- VersionChanged: '2.13'
319
+ VersionChanged: '2.31'
317
320
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyExampleGroup
318
321
 
319
322
  RSpec/EmptyHook:
320
323
  Description: Checks for empty before and after hooks.
321
324
  Enabled: true
325
+ AutoCorrect: contextual
322
326
  VersionAdded: '1.39'
327
+ VersionChanged: '2.31'
323
328
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyHook
324
329
 
325
330
  RSpec/EmptyLineAfterExample:
@@ -362,19 +367,21 @@ RSpec/EmptyLineAfterSubject:
362
367
 
363
368
  RSpec/EmptyMetadata:
364
369
  Description: Avoid empty metadata hash.
365
- Enabled: pending
370
+ Enabled: true
371
+ AutoCorrect: contextual
366
372
  VersionAdded: '2.24'
373
+ VersionChanged: '2.31'
367
374
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyMetadata
368
375
 
369
376
  RSpec/EmptyOutput:
370
377
  Description: Check that the `output` matcher is not called with an empty string.
371
- Enabled: pending
378
+ Enabled: true
372
379
  VersionAdded: '2.29'
373
380
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyOutput
374
381
 
375
382
  RSpec/Eq:
376
383
  Description: Use `eq` instead of `be ==` to compare objects.
377
- Enabled: pending
384
+ Enabled: true
378
385
  VersionAdded: '2.24'
379
386
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Eq
380
387
 
@@ -416,7 +423,7 @@ RSpec/ExampleWording:
416
423
 
417
424
  RSpec/ExcessiveDocstringSpacing:
418
425
  Description: Checks for excessive whitespace in example descriptions.
419
- Enabled: pending
426
+ Enabled: true
420
427
  VersionAdded: '2.5'
421
428
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExcessiveDocstringSpacing
422
429
 
@@ -447,32 +454,24 @@ RSpec/ExpectInHook:
447
454
  VersionAdded: '1.16'
448
455
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectInHook
449
456
 
457
+ RSpec/ExpectInLet:
458
+ Description: Do not use `expect` in let.
459
+ Enabled: true
460
+ VersionAdded: '2.30'
461
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectInLet
462
+
450
463
  RSpec/ExpectOutput:
451
464
  Description: Checks for opportunities to use `expect { ... }.to output`.
452
465
  Enabled: true
453
466
  VersionAdded: '1.10'
454
467
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectOutput
455
468
 
456
- RSpec/FilePath:
457
- Description: Checks that spec file paths are consistent and well-formed.
458
- Enabled: true
459
- Include:
460
- - "**/*_spec*rb*"
461
- - "**/spec/**/*"
462
- CustomTransform:
463
- RuboCop: rubocop
464
- RSpec: rspec
465
- IgnoreMethods: false
466
- SpecSuffixOnly: false
467
- VersionAdded: '1.2'
468
- VersionChanged: '2.24'
469
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath
470
-
471
469
  RSpec/Focus:
472
470
  Description: Checks if examples are focused.
473
471
  Enabled: true
472
+ AutoCorrect: contextual
474
473
  VersionAdded: '1.5'
475
- VersionChanged: '2.1'
474
+ VersionChanged: '2.31'
476
475
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Focus
477
476
 
478
477
  RSpec/HookArgument:
@@ -490,12 +489,14 @@ RSpec/HookArgument:
490
489
  RSpec/HooksBeforeExamples:
491
490
  Description: Checks for before/around/after hooks that come after an example.
492
491
  Enabled: true
492
+ AutoCorrect: contextual
493
493
  VersionAdded: '1.29'
494
+ VersionChanged: '2.31'
494
495
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HooksBeforeExamples
495
496
 
496
497
  RSpec/IdenticalEqualityAssertion:
497
498
  Description: Checks for equality assertions with identical expressions on both sides.
498
- Enabled: pending
499
+ Enabled: true
499
500
  VersionAdded: '2.4'
500
501
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IdenticalEqualityAssertion
501
502
 
@@ -532,7 +533,7 @@ RSpec/ImplicitSubject:
532
533
 
533
534
  RSpec/IndexedLet:
534
535
  Description: Do not set up test data using indexes (e.g., `item_1`, `item_2`).
535
- Enabled: pending
536
+ Enabled: true
536
537
  VersionAdded: '2.20'
537
538
  VersionChanged: '2.23'
538
539
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IndexedLet
@@ -557,7 +558,7 @@ RSpec/InstanceVariable:
557
558
 
558
559
  RSpec/IsExpectedSpecify:
559
560
  Description: Check for `specify` with `is_expected` and one-liner expectations.
560
- Enabled: pending
561
+ Enabled: true
561
562
  VersionAdded: '2.27'
562
563
  StyleGuide: https://rspec.rubystyle.guide/#it-and-specify
563
564
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IsExpectedSpecify
@@ -596,8 +597,9 @@ RSpec/LeakyConstantDeclaration:
596
597
  RSpec/LetBeforeExamples:
597
598
  Description: Checks for `let` definitions that come after an example.
598
599
  Enabled: true
600
+ AutoCorrect: contextual
599
601
  VersionAdded: '1.16'
600
- VersionChanged: '1.22'
602
+ VersionChanged: '2.31'
601
603
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetBeforeExamples
602
604
 
603
605
  RSpec/LetSetup:
@@ -608,7 +610,7 @@ RSpec/LetSetup:
608
610
 
609
611
  RSpec/MatchArray:
610
612
  Description: Checks where `match_array` is used.
611
- Enabled: pending
613
+ Enabled: true
612
614
  VersionAdded: '2.19'
613
615
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MatchArray
614
616
 
@@ -641,7 +643,7 @@ RSpec/MessageSpies:
641
643
 
642
644
  RSpec/MetadataStyle:
643
645
  Description: Use consistent metadata style.
644
- Enabled: pending
646
+ Enabled: true
645
647
  EnforcedStyle: symbol
646
648
  SupportedStyles:
647
649
  - hash
@@ -655,6 +657,12 @@ RSpec/MissingExampleGroupArgument:
655
657
  VersionAdded: '1.28'
656
658
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExampleGroupArgument
657
659
 
660
+ RSpec/MissingExpectationTargetMethod:
661
+ Description: Checks if `.to`, `not_to` or `to_not` are used.
662
+ Enabled: true
663
+ VersionAdded: '3.0'
664
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExpectationTargetMethod
665
+
658
666
  RSpec/MultipleDescribes:
659
667
  Description: Checks for multiple top-level example groups.
660
668
  Enabled: true
@@ -709,7 +717,7 @@ RSpec/NestedGroups:
709
717
 
710
718
  RSpec/NoExpectationExample:
711
719
  Description: Checks if an example contains any expectation.
712
- Enabled: pending
720
+ Enabled: true
713
721
  Safe: false
714
722
  VersionAdded: '2.13'
715
723
  VersionChanged: '2.14'
@@ -742,7 +750,7 @@ RSpec/Pending:
742
750
 
743
751
  RSpec/PendingWithoutReason:
744
752
  Description: Checks for pending or skipped examples without reason.
745
- Enabled: pending
753
+ Enabled: true
746
754
  VersionAdded: '2.16'
747
755
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PendingWithoutReason
748
756
 
@@ -768,7 +776,7 @@ RSpec/ReceiveCounts:
768
776
 
769
777
  RSpec/ReceiveMessages:
770
778
  Description: Checks for multiple messages stubbed on the same object.
771
- Enabled: pending
779
+ Enabled: true
772
780
  SafeAutoCorrect: false
773
781
  VersionAdded: '2.23'
774
782
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveMessages
@@ -781,19 +789,19 @@ RSpec/ReceiveNever:
781
789
 
782
790
  RSpec/RedundantAround:
783
791
  Description: Remove redundant `around` hook.
784
- Enabled: pending
792
+ Enabled: true
785
793
  VersionAdded: '2.19'
786
794
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RedundantAround
787
795
 
788
796
  RSpec/RedundantPredicateMatcher:
789
797
  Description: Checks for redundant predicate matcher.
790
- Enabled: pending
798
+ Enabled: true
791
799
  VersionAdded: '2.26'
792
800
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RedundantPredicateMatcher
793
801
 
794
802
  RSpec/RemoveConst:
795
803
  Description: Checks that `remove_const` is not used in specs.
796
- Enabled: pending
804
+ Enabled: true
797
805
  VersionAdded: '2.26'
798
806
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RemoveConst
799
807
 
@@ -829,7 +837,7 @@ RSpec/RepeatedIncludeExample:
829
837
 
830
838
  RSpec/RepeatedSubjectCall:
831
839
  Description: Checks for repeated calls to subject missing that it is memoized.
832
- Enabled: pending
840
+ Enabled: true
833
841
  VersionAdded: '2.27'
834
842
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedSubjectCall
835
843
 
@@ -847,14 +855,17 @@ RSpec/ReturnFromStub:
847
855
  RSpec/ScatteredLet:
848
856
  Description: Checks for let scattered across the example group.
849
857
  Enabled: true
858
+ AutoCorrect: contextual
850
859
  VersionAdded: '1.14'
851
- VersionChanged: '1.39'
860
+ VersionChanged: '2.31'
852
861
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredLet
853
862
 
854
863
  RSpec/ScatteredSetup:
855
864
  Description: Checks for setup scattered across multiple hooks in an example group.
856
865
  Enabled: true
866
+ AutoCorrect: contextual
857
867
  VersionAdded: '1.10'
868
+ VersionChanged: '2.31'
858
869
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredSetup
859
870
 
860
871
  RSpec/SharedContext:
@@ -883,19 +894,19 @@ RSpec/SingleArgumentMessageChain:
883
894
 
884
895
  RSpec/SkipBlockInsideExample:
885
896
  Description: Checks for passing a block to `skip` within examples.
886
- Enabled: pending
897
+ Enabled: true
887
898
  VersionAdded: '2.19'
888
899
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SkipBlockInsideExample
889
900
 
890
901
  RSpec/SortMetadata:
891
902
  Description: Sort RSpec metadata alphabetically.
892
- Enabled: pending
903
+ Enabled: true
893
904
  VersionAdded: '2.14'
894
905
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SortMetadata
895
906
 
896
907
  RSpec/SpecFilePathFormat:
897
908
  Description: Checks that spec file paths are consistent and well-formed.
898
- Enabled: pending
909
+ Enabled: true
899
910
  Include:
900
911
  - "**/*_spec.rb"
901
912
  Exclude:
@@ -911,7 +922,7 @@ RSpec/SpecFilePathFormat:
911
922
 
912
923
  RSpec/SpecFilePathSuffix:
913
924
  Description: Checks that spec file paths suffix are consistent and well-formed.
914
- Enabled: pending
925
+ Enabled: true
915
926
  VersionAdded: '2.24'
916
927
  Include:
917
928
  - "**/*_spec*rb*"
@@ -926,7 +937,7 @@ RSpec/StubbedMock:
926
937
 
927
938
  RSpec/SubjectDeclaration:
928
939
  Description: Ensure that subject is defined using subject helper.
929
- Enabled: pending
940
+ Enabled: true
930
941
  VersionAdded: '2.5'
931
942
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SubjectDeclaration
932
943
 
@@ -940,7 +951,7 @@ RSpec/SubjectStub:
940
951
 
941
952
  RSpec/UndescriptiveLiteralsDescription:
942
953
  Description: Description should be descriptive.
943
- Enabled: pending
954
+ Enabled: true
944
955
  VersionAdded: '2.29'
945
956
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/UndescriptiveLiteralsDescription
946
957
 
@@ -974,7 +985,7 @@ RSpec/VariableName:
974
985
 
975
986
  RSpec/VerifiedDoubleReference:
976
987
  Description: Checks for consistent verified double reference style.
977
- Enabled: pending
988
+ Enabled: true
978
989
  SafeAutoCorrect: false
979
990
  EnforcedStyle: constant
980
991
  SupportedStyles:
@@ -1005,216 +1016,3 @@ RSpec/Yield:
1005
1016
  Enabled: true
1006
1017
  VersionAdded: '1.32'
1007
1018
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Yield
1008
-
1009
- RSpec/Capybara:
1010
- Enabled: true
1011
- Include: *1
1012
- Language: *2
1013
-
1014
- RSpec/Capybara/CurrentPathExpectation:
1015
- Description: Checks that no expectations are set on Capybara's `current_path`.
1016
- Enabled: true
1017
- VersionAdded: '1.18'
1018
- VersionChanged: '2.0'
1019
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/CurrentPathExpectation
1020
-
1021
- RSpec/Capybara/FeatureMethods:
1022
- Description: Checks for consistent method usage in feature specs.
1023
- Enabled: true
1024
- EnabledMethods: []
1025
- VersionAdded: '1.17'
1026
- VersionChanged: '2.0'
1027
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods
1028
-
1029
- RSpec/Capybara/MatchStyle:
1030
- Description: Checks for usage of deprecated style methods.
1031
- Enabled: pending
1032
- VersionAdded: '2.17'
1033
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/MatchStyle
1034
-
1035
- RSpec/Capybara/NegationMatcher:
1036
- Description: Enforces use of `have_no_*` or `not_to` for negated expectations.
1037
- Enabled: pending
1038
- VersionAdded: '2.14'
1039
- EnforcedStyle: not_to
1040
- SupportedStyles:
1041
- - have_no
1042
- - not_to
1043
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/NegationMatcher
1044
-
1045
- RSpec/Capybara/SpecificActions:
1046
- Description: Checks for there is a more specific actions offered by Capybara.
1047
- Enabled: pending
1048
- VersionAdded: '2.14'
1049
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/SpecificActions
1050
-
1051
- RSpec/Capybara/SpecificFinders:
1052
- Description: Checks if there is a more specific finder offered by Capybara.
1053
- Enabled: pending
1054
- VersionAdded: '2.13'
1055
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/SpecificFinders
1056
-
1057
- RSpec/Capybara/SpecificMatcher:
1058
- Description: Checks for there is a more specific matcher offered by Capybara.
1059
- Enabled: pending
1060
- VersionAdded: '2.12'
1061
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/SpecificMatcher
1062
-
1063
- RSpec/Capybara/VisibilityMatcher:
1064
- Description: Checks for boolean visibility in Capybara finders.
1065
- Enabled: true
1066
- VersionAdded: '1.39'
1067
- VersionChanged: '2.0'
1068
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/VisibilityMatcher
1069
-
1070
- RSpec/FactoryBot:
1071
- Enabled: true
1072
- Include: *1
1073
- Language: *2
1074
-
1075
- RSpec/FactoryBot/AttributeDefinedStatically:
1076
- Description: Always declare attribute values as blocks.
1077
- Enabled: true
1078
- Include:
1079
- - "**/spec/factories.rb"
1080
- - "**/spec/factories/**/*.rb"
1081
- - "**/features/support/factories/**/*.rb"
1082
- VersionAdded: '1.28'
1083
- VersionChanged: '2.23'
1084
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/AttributeDefinedStatically
1085
-
1086
- RSpec/FactoryBot/ConsistentParenthesesStyle:
1087
- Description: Use a consistent style for parentheses in factory bot calls.
1088
- Enabled: pending
1089
- EnforcedStyle: require_parentheses
1090
- SupportedStyles:
1091
- - require_parentheses
1092
- - omit_parentheses
1093
- VersionAdded: '2.14'
1094
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/ConsistentParenthesesStyle
1095
-
1096
- RSpec/FactoryBot/CreateList:
1097
- Description: Checks for create_list usage.
1098
- Enabled: true
1099
- Include:
1100
- - "**/*_spec.rb"
1101
- - "**/spec/**/*"
1102
- - "**/spec/factories.rb"
1103
- - "**/spec/factories/**/*.rb"
1104
- - "**/features/support/factories/**/*.rb"
1105
- EnforcedStyle: create_list
1106
- SupportedStyles:
1107
- - create_list
1108
- - n_times
1109
- VersionAdded: '1.25'
1110
- VersionChanged: '2.23'
1111
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList
1112
-
1113
- RSpec/FactoryBot/FactoryClassName:
1114
- Description: Use string value when setting the class attribute explicitly.
1115
- Enabled: true
1116
- Include:
1117
- - "**/spec/factories.rb"
1118
- - "**/spec/factories/**/*.rb"
1119
- - "**/features/support/factories/**/*.rb"
1120
- VersionAdded: '1.37'
1121
- VersionChanged: '2.23'
1122
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName
1123
-
1124
- RSpec/FactoryBot/FactoryNameStyle:
1125
- Description: Checks for name style for argument of FactoryBot::Syntax::Methods.
1126
- Enabled: pending
1127
- VersionAdded: '2.16'
1128
- EnforcedStyle: symbol
1129
- SupportedStyles:
1130
- - symbol
1131
- - string
1132
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryNameStyle
1133
-
1134
- RSpec/FactoryBot/SyntaxMethods:
1135
- Description: Use shorthands from `FactoryBot::Syntax::Methods` in your specs.
1136
- Enabled: pending
1137
- SafeAutoCorrect: false
1138
- VersionAdded: '2.7'
1139
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/SyntaxMethods
1140
-
1141
- RSpec/Rails:
1142
- Enabled: true
1143
- Include: *1
1144
- Language: *2
1145
-
1146
- RSpec/Rails/AvoidSetupHook:
1147
- Description: Checks that tests use RSpec `before` hook over Rails `setup` method.
1148
- Enabled: pending
1149
- VersionAdded: '2.4'
1150
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/AvoidSetupHook
1151
-
1152
- RSpec/Rails/HaveHttpStatus:
1153
- Description: Checks that tests use `have_http_status` instead of equality matchers.
1154
- Enabled: pending
1155
- ResponseMethods:
1156
- - response
1157
- - last_response
1158
- SafeAutoCorrect: false
1159
- VersionAdded: '2.12'
1160
- VersionChanged: '2.27'
1161
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HaveHttpStatus
1162
-
1163
- RSpec/Rails/HttpStatus:
1164
- Description: Enforces use of symbolic or numeric value to describe HTTP status.
1165
- Enabled: true
1166
- EnforcedStyle: symbolic
1167
- SupportedStyles:
1168
- - numeric
1169
- - symbolic
1170
- - be_status
1171
- VersionAdded: '1.23'
1172
- VersionChanged: '2.20'
1173
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus
1174
-
1175
- RSpec/Rails/InferredSpecType:
1176
- Description: Identifies redundant spec type.
1177
- Enabled: pending
1178
- Safe: false
1179
- VersionAdded: '2.14'
1180
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/InferredSpecType
1181
- Inferences:
1182
- channels: channel
1183
- controllers: controller
1184
- features: feature
1185
- generator: generator
1186
- helpers: helper
1187
- jobs: job
1188
- mailboxes: mailbox
1189
- mailers: mailer
1190
- models: model
1191
- requests: request
1192
- integration: request
1193
- api: request
1194
- routing: routing
1195
- system: system
1196
- views: view
1197
-
1198
- RSpec/Rails/MinitestAssertions:
1199
- Description: Check if using Minitest-like matchers.
1200
- Enabled: pending
1201
- VersionAdded: '2.17'
1202
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/MinitestAssertions
1203
-
1204
- RSpec/Rails/NegationBeValid:
1205
- Description: Enforces use of `be_invalid` or `not_to` for negated be_valid.
1206
- Safe: false
1207
- EnforcedStyle: not_to
1208
- SupportedStyles:
1209
- - not_to
1210
- - be_invalid
1211
- Enabled: pending
1212
- VersionAdded: '2.23'
1213
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/NegationBeValid
1214
-
1215
- RSpec/Rails/TravelAround:
1216
- Description: Prefer to travel in `before` rather than `around`.
1217
- Enabled: pending
1218
- Safe: false
1219
- VersionAdded: '2.19'
1220
- Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/TravelAround
@@ -34,3 +34,14 @@ renamed:
34
34
  RSpec/Rails/MinitestAssertions: RSpecRails/MinitestAssertions
35
35
  RSpec/Rails/NegationBeValid: RSpecRails/NegationBeValid
36
36
  RSpec/Rails/TravelAround: RSpecRails/TravelAround
37
+
38
+ split:
39
+ RSpec/FilePath:
40
+ alternatives:
41
+ - RSpec/SpecFilePathFormat
42
+ - RSpec/SpecFilePathSuffix
43
+
44
+ removed:
45
+ RSpec/Capybara/FeatureMethods:
46
+ reason: >
47
+ this cop has migrated to `RSpec/Dialect`. Please use `RSpec/Dialect` instead