rubocop-rspec 2.31.0 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +1 -1
- data/config/default.yml +39 -261
- data/config/obsoletion.yml +11 -0
- data/lib/rubocop/cop/rspec/base.rb +0 -1
- data/lib/rubocop/cop/rspec/dialect.rb +13 -0
- data/lib/rubocop/cop/rspec/expect_actual.rb +1 -1
- data/lib/rubocop/cop/rspec/expect_in_hook.rb +1 -1
- data/lib/rubocop/cop/rspec/expect_in_let.rb +1 -3
- data/lib/rubocop/cop/rspec/leaky_constant_declaration.rb +1 -1
- data/lib/rubocop/cop/rspec/missing_expectation_target_method.rb +54 -0
- data/lib/rubocop/cop/rspec/multiple_describes.rb +1 -1
- data/lib/rubocop/cop/rspec/multiple_expectations.rb +2 -2
- data/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb +2 -4
- data/lib/rubocop/cop/rspec/named_subject.rb +5 -2
- data/lib/rubocop/cop/rspec/predicate_matcher.rb +1 -1
- data/lib/rubocop/cop/rspec/remove_const.rb +0 -1
- data/lib/rubocop/cop/rspec/scattered_setup.rb +1 -1
- data/lib/rubocop/cop/rspec/sort_metadata.rb +1 -1
- data/lib/rubocop/cop/rspec/stubbed_mock.rb +3 -1
- data/lib/rubocop/cop/rspec/subject_stub.rb +2 -2
- data/lib/rubocop/cop/rspec_cops.rb +1 -25
- data/lib/rubocop/rspec/concept.rb +0 -1
- data/lib/rubocop/rspec/config_formatter.rb +1 -24
- data/lib/rubocop/rspec/cop/generator.rb +25 -0
- data/lib/rubocop/rspec/language.rb +0 -1
- data/lib/rubocop/rspec/shared_contexts/default_rspec_language_config_context.rb +1 -1
- data/lib/rubocop/rspec/version.rb +1 -1
- data/lib/rubocop-rspec.rb +1 -17
- metadata +6 -69
- data/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb +0 -39
- data/lib/rubocop/cop/rspec/capybara/feature_methods.rb +0 -104
- data/lib/rubocop/cop/rspec/capybara/match_style.rb +0 -38
- data/lib/rubocop/cop/rspec/capybara/negation_matcher.rb +0 -33
- data/lib/rubocop/cop/rspec/capybara/specific_actions.rb +0 -29
- data/lib/rubocop/cop/rspec/capybara/specific_finders.rb +0 -24
- data/lib/rubocop/cop/rspec/capybara/specific_matcher.rb +0 -35
- data/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb +0 -36
- data/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb +0 -35
- data/lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb +0 -50
- data/lib/rubocop/cop/rspec/factory_bot/create_list.rb +0 -40
- data/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb +0 -29
- data/lib/rubocop/cop/rspec/factory_bot/factory_name_style.rb +0 -33
- data/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb +0 -55
- data/lib/rubocop/cop/rspec/file_path.rb +0 -179
- data/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb +0 -27
- data/lib/rubocop/cop/rspec/rails/have_http_status.rb +0 -35
- data/lib/rubocop/cop/rspec/rails/http_status.rb +0 -61
- data/lib/rubocop/cop/rspec/rails/inferred_spec_type.rb +0 -62
- data/lib/rubocop/cop/rspec/rails/minitest_assertions.rb +0 -39
- data/lib/rubocop/cop/rspec/rails/negation_be_valid.rb +0 -39
- data/lib/rubocop/cop/rspec/rails/travel_around.rb +0 -34
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b642c03d2fb24a8ac19e4e9ea60b7db9267550533be56cf6bb01b79724f7ec5f
|
4
|
+
data.tar.gz: 560dcc8a649c9556ea38021addb497c188eeb794432e307c13203bfe0d8d3d56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58f1eeb3b7a5c23629f76b87a4d1f66f1654bede0b59a4b8f9d7636f78d845850bf7518d87fac5a6daea2dda7bd13f844c59954ef231ce99a7cf310816891009
|
7
|
+
data.tar.gz: 4646cb7db9590720e985fa24b7cec2908af6b0a5c4ae61b882587f189f95b705dbf8f0272d7d30f2d0af569e4ec8d2cee9a20ba8ada819c3948c6a29dd6b3962
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,23 @@
|
|
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
|
+
|
5
22
|
## 2.31.0 (2024-06-07)
|
6
23
|
|
7
24
|
- Support `AutoCorrect: contextual` option for LSP. ([@ydah])
|
@@ -893,6 +910,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
|
|
893
910
|
[@drowze]: https://github.com/Drowze
|
894
911
|
[@dswij]: https://github.com/dswij
|
895
912
|
[@dvandersluis]: https://github.com/dvandersluis
|
913
|
+
[@earlopain]: https://github.com/earlopain
|
896
914
|
[@edgibbs]: https://github.com/edgibbs
|
897
915
|
[@eikes]: https://github.com/eikes
|
898
916
|
[@eitoball]: https://github.com/eitoball
|
@@ -924,6 +942,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
|
|
924
942
|
[@k-s-a]: https://github.com/K-S-A
|
925
943
|
[@kellysutton]: https://github.com/kellysutton
|
926
944
|
[@koic]: https://github.com/koic
|
945
|
+
[@krororo]: https://github.com/krororo
|
927
946
|
[@kuahyeow]: https://github.com/kuahyeow
|
928
947
|
[@lazycoder9]: https://github.com/lazycoder9
|
929
948
|
[@leoarnold]: https://github.com/leoarnold
|
data/README.md
CHANGED
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:
|
6
|
+
Include:
|
7
7
|
- "**/*_spec.rb"
|
8
8
|
- "**/spec/**/*"
|
9
|
-
Language:
|
9
|
+
Language:
|
10
10
|
inherit_mode:
|
11
11
|
merge:
|
12
12
|
- Expectations
|
@@ -146,7 +146,7 @@ RSpec/Be:
|
|
146
146
|
|
147
147
|
RSpec/BeEmpty:
|
148
148
|
Description: Prefer using `be_empty` when checking for an empty array.
|
149
|
-
Enabled:
|
149
|
+
Enabled: true
|
150
150
|
AutoCorrect: contextual
|
151
151
|
VersionAdded: '2.20'
|
152
152
|
VersionChanged: '2.31'
|
@@ -154,7 +154,7 @@ RSpec/BeEmpty:
|
|
154
154
|
|
155
155
|
RSpec/BeEq:
|
156
156
|
Description: Check for expectations where `be(...)` can replace `eq(...)`.
|
157
|
-
Enabled:
|
157
|
+
Enabled: true
|
158
158
|
Safe: false
|
159
159
|
VersionAdded: 2.9.0
|
160
160
|
VersionChanged: '2.16'
|
@@ -170,7 +170,7 @@ RSpec/BeEql:
|
|
170
170
|
|
171
171
|
RSpec/BeNil:
|
172
172
|
Description: Ensures a consistent style is used when matching `nil`.
|
173
|
-
Enabled:
|
173
|
+
Enabled: true
|
174
174
|
EnforcedStyle: be_nil
|
175
175
|
SupportedStyles:
|
176
176
|
- be
|
@@ -193,7 +193,7 @@ RSpec/BeforeAfterAll:
|
|
193
193
|
|
194
194
|
RSpec/ChangeByZero:
|
195
195
|
Description: Prefer negated matchers over `to change.by(0)`.
|
196
|
-
Enabled:
|
196
|
+
Enabled: true
|
197
197
|
VersionAdded: '2.11'
|
198
198
|
VersionChanged: '2.14'
|
199
199
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ChangeByZero
|
@@ -202,7 +202,7 @@ RSpec/ChangeByZero:
|
|
202
202
|
RSpec/ClassCheck:
|
203
203
|
Description: Enforces consistent use of `be_a` or `be_kind_of`.
|
204
204
|
StyleGuide: "#is-a-vs-kind-of"
|
205
|
-
Enabled:
|
205
|
+
Enabled: true
|
206
206
|
VersionAdded: '2.13'
|
207
207
|
EnforcedStyle: be_a
|
208
208
|
SupportedStyles:
|
@@ -212,7 +212,7 @@ RSpec/ClassCheck:
|
|
212
212
|
|
213
213
|
RSpec/ContainExactly:
|
214
214
|
Description: Checks where `contain_exactly` is used.
|
215
|
-
Enabled:
|
215
|
+
Enabled: true
|
216
216
|
VersionAdded: '2.19'
|
217
217
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContainExactly
|
218
218
|
|
@@ -306,7 +306,7 @@ RSpec/Dialect:
|
|
306
306
|
|
307
307
|
RSpec/DuplicatedMetadata:
|
308
308
|
Description: Avoid duplicated metadata.
|
309
|
-
Enabled:
|
309
|
+
Enabled: true
|
310
310
|
VersionAdded: '2.16'
|
311
311
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DuplicatedMetadata
|
312
312
|
|
@@ -367,7 +367,7 @@ RSpec/EmptyLineAfterSubject:
|
|
367
367
|
|
368
368
|
RSpec/EmptyMetadata:
|
369
369
|
Description: Avoid empty metadata hash.
|
370
|
-
Enabled:
|
370
|
+
Enabled: true
|
371
371
|
AutoCorrect: contextual
|
372
372
|
VersionAdded: '2.24'
|
373
373
|
VersionChanged: '2.31'
|
@@ -375,13 +375,13 @@ RSpec/EmptyMetadata:
|
|
375
375
|
|
376
376
|
RSpec/EmptyOutput:
|
377
377
|
Description: Check that the `output` matcher is not called with an empty string.
|
378
|
-
Enabled:
|
378
|
+
Enabled: true
|
379
379
|
VersionAdded: '2.29'
|
380
380
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyOutput
|
381
381
|
|
382
382
|
RSpec/Eq:
|
383
383
|
Description: Use `eq` instead of `be ==` to compare objects.
|
384
|
-
Enabled:
|
384
|
+
Enabled: true
|
385
385
|
VersionAdded: '2.24'
|
386
386
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Eq
|
387
387
|
|
@@ -423,7 +423,7 @@ RSpec/ExampleWording:
|
|
423
423
|
|
424
424
|
RSpec/ExcessiveDocstringSpacing:
|
425
425
|
Description: Checks for excessive whitespace in example descriptions.
|
426
|
-
Enabled:
|
426
|
+
Enabled: true
|
427
427
|
VersionAdded: '2.5'
|
428
428
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExcessiveDocstringSpacing
|
429
429
|
|
@@ -456,7 +456,7 @@ RSpec/ExpectInHook:
|
|
456
456
|
|
457
457
|
RSpec/ExpectInLet:
|
458
458
|
Description: Do not use `expect` in let.
|
459
|
-
Enabled:
|
459
|
+
Enabled: true
|
460
460
|
VersionAdded: '2.30'
|
461
461
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectInLet
|
462
462
|
|
@@ -466,21 +466,6 @@ RSpec/ExpectOutput:
|
|
466
466
|
VersionAdded: '1.10'
|
467
467
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectOutput
|
468
468
|
|
469
|
-
RSpec/FilePath:
|
470
|
-
Description: Checks that spec file paths are consistent and well-formed.
|
471
|
-
Enabled: true
|
472
|
-
Include:
|
473
|
-
- "**/*_spec*rb*"
|
474
|
-
- "**/spec/**/*"
|
475
|
-
CustomTransform:
|
476
|
-
RuboCop: rubocop
|
477
|
-
RSpec: rspec
|
478
|
-
IgnoreMethods: false
|
479
|
-
SpecSuffixOnly: false
|
480
|
-
VersionAdded: '1.2'
|
481
|
-
VersionChanged: '2.24'
|
482
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath
|
483
|
-
|
484
469
|
RSpec/Focus:
|
485
470
|
Description: Checks if examples are focused.
|
486
471
|
Enabled: true
|
@@ -511,7 +496,7 @@ RSpec/HooksBeforeExamples:
|
|
511
496
|
|
512
497
|
RSpec/IdenticalEqualityAssertion:
|
513
498
|
Description: Checks for equality assertions with identical expressions on both sides.
|
514
|
-
Enabled:
|
499
|
+
Enabled: true
|
515
500
|
VersionAdded: '2.4'
|
516
501
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IdenticalEqualityAssertion
|
517
502
|
|
@@ -548,7 +533,7 @@ RSpec/ImplicitSubject:
|
|
548
533
|
|
549
534
|
RSpec/IndexedLet:
|
550
535
|
Description: Do not set up test data using indexes (e.g., `item_1`, `item_2`).
|
551
|
-
Enabled:
|
536
|
+
Enabled: true
|
552
537
|
VersionAdded: '2.20'
|
553
538
|
VersionChanged: '2.23'
|
554
539
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IndexedLet
|
@@ -573,7 +558,7 @@ RSpec/InstanceVariable:
|
|
573
558
|
|
574
559
|
RSpec/IsExpectedSpecify:
|
575
560
|
Description: Check for `specify` with `is_expected` and one-liner expectations.
|
576
|
-
Enabled:
|
561
|
+
Enabled: true
|
577
562
|
VersionAdded: '2.27'
|
578
563
|
StyleGuide: https://rspec.rubystyle.guide/#it-and-specify
|
579
564
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IsExpectedSpecify
|
@@ -625,7 +610,7 @@ RSpec/LetSetup:
|
|
625
610
|
|
626
611
|
RSpec/MatchArray:
|
627
612
|
Description: Checks where `match_array` is used.
|
628
|
-
Enabled:
|
613
|
+
Enabled: true
|
629
614
|
VersionAdded: '2.19'
|
630
615
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MatchArray
|
631
616
|
|
@@ -658,7 +643,7 @@ RSpec/MessageSpies:
|
|
658
643
|
|
659
644
|
RSpec/MetadataStyle:
|
660
645
|
Description: Use consistent metadata style.
|
661
|
-
Enabled:
|
646
|
+
Enabled: true
|
662
647
|
EnforcedStyle: symbol
|
663
648
|
SupportedStyles:
|
664
649
|
- hash
|
@@ -672,6 +657,12 @@ RSpec/MissingExampleGroupArgument:
|
|
672
657
|
VersionAdded: '1.28'
|
673
658
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExampleGroupArgument
|
674
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
|
+
|
675
666
|
RSpec/MultipleDescribes:
|
676
667
|
Description: Checks for multiple top-level example groups.
|
677
668
|
Enabled: true
|
@@ -726,7 +717,7 @@ RSpec/NestedGroups:
|
|
726
717
|
|
727
718
|
RSpec/NoExpectationExample:
|
728
719
|
Description: Checks if an example contains any expectation.
|
729
|
-
Enabled:
|
720
|
+
Enabled: true
|
730
721
|
Safe: false
|
731
722
|
VersionAdded: '2.13'
|
732
723
|
VersionChanged: '2.14'
|
@@ -759,7 +750,7 @@ RSpec/Pending:
|
|
759
750
|
|
760
751
|
RSpec/PendingWithoutReason:
|
761
752
|
Description: Checks for pending or skipped examples without reason.
|
762
|
-
Enabled:
|
753
|
+
Enabled: true
|
763
754
|
VersionAdded: '2.16'
|
764
755
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PendingWithoutReason
|
765
756
|
|
@@ -785,7 +776,7 @@ RSpec/ReceiveCounts:
|
|
785
776
|
|
786
777
|
RSpec/ReceiveMessages:
|
787
778
|
Description: Checks for multiple messages stubbed on the same object.
|
788
|
-
Enabled:
|
779
|
+
Enabled: true
|
789
780
|
SafeAutoCorrect: false
|
790
781
|
VersionAdded: '2.23'
|
791
782
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveMessages
|
@@ -798,19 +789,19 @@ RSpec/ReceiveNever:
|
|
798
789
|
|
799
790
|
RSpec/RedundantAround:
|
800
791
|
Description: Remove redundant `around` hook.
|
801
|
-
Enabled:
|
792
|
+
Enabled: true
|
802
793
|
VersionAdded: '2.19'
|
803
794
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RedundantAround
|
804
795
|
|
805
796
|
RSpec/RedundantPredicateMatcher:
|
806
797
|
Description: Checks for redundant predicate matcher.
|
807
|
-
Enabled:
|
798
|
+
Enabled: true
|
808
799
|
VersionAdded: '2.26'
|
809
800
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RedundantPredicateMatcher
|
810
801
|
|
811
802
|
RSpec/RemoveConst:
|
812
803
|
Description: Checks that `remove_const` is not used in specs.
|
813
|
-
Enabled:
|
804
|
+
Enabled: true
|
814
805
|
VersionAdded: '2.26'
|
815
806
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RemoveConst
|
816
807
|
|
@@ -846,7 +837,7 @@ RSpec/RepeatedIncludeExample:
|
|
846
837
|
|
847
838
|
RSpec/RepeatedSubjectCall:
|
848
839
|
Description: Checks for repeated calls to subject missing that it is memoized.
|
849
|
-
Enabled:
|
840
|
+
Enabled: true
|
850
841
|
VersionAdded: '2.27'
|
851
842
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedSubjectCall
|
852
843
|
|
@@ -903,19 +894,19 @@ RSpec/SingleArgumentMessageChain:
|
|
903
894
|
|
904
895
|
RSpec/SkipBlockInsideExample:
|
905
896
|
Description: Checks for passing a block to `skip` within examples.
|
906
|
-
Enabled:
|
897
|
+
Enabled: true
|
907
898
|
VersionAdded: '2.19'
|
908
899
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SkipBlockInsideExample
|
909
900
|
|
910
901
|
RSpec/SortMetadata:
|
911
902
|
Description: Sort RSpec metadata alphabetically.
|
912
|
-
Enabled:
|
903
|
+
Enabled: true
|
913
904
|
VersionAdded: '2.14'
|
914
905
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SortMetadata
|
915
906
|
|
916
907
|
RSpec/SpecFilePathFormat:
|
917
908
|
Description: Checks that spec file paths are consistent and well-formed.
|
918
|
-
Enabled:
|
909
|
+
Enabled: true
|
919
910
|
Include:
|
920
911
|
- "**/*_spec.rb"
|
921
912
|
Exclude:
|
@@ -931,7 +922,7 @@ RSpec/SpecFilePathFormat:
|
|
931
922
|
|
932
923
|
RSpec/SpecFilePathSuffix:
|
933
924
|
Description: Checks that spec file paths suffix are consistent and well-formed.
|
934
|
-
Enabled:
|
925
|
+
Enabled: true
|
935
926
|
VersionAdded: '2.24'
|
936
927
|
Include:
|
937
928
|
- "**/*_spec*rb*"
|
@@ -946,7 +937,7 @@ RSpec/StubbedMock:
|
|
946
937
|
|
947
938
|
RSpec/SubjectDeclaration:
|
948
939
|
Description: Ensure that subject is defined using subject helper.
|
949
|
-
Enabled:
|
940
|
+
Enabled: true
|
950
941
|
VersionAdded: '2.5'
|
951
942
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SubjectDeclaration
|
952
943
|
|
@@ -960,7 +951,7 @@ RSpec/SubjectStub:
|
|
960
951
|
|
961
952
|
RSpec/UndescriptiveLiteralsDescription:
|
962
953
|
Description: Description should be descriptive.
|
963
|
-
Enabled:
|
954
|
+
Enabled: true
|
964
955
|
VersionAdded: '2.29'
|
965
956
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/UndescriptiveLiteralsDescription
|
966
957
|
|
@@ -994,7 +985,7 @@ RSpec/VariableName:
|
|
994
985
|
|
995
986
|
RSpec/VerifiedDoubleReference:
|
996
987
|
Description: Checks for consistent verified double reference style.
|
997
|
-
Enabled:
|
988
|
+
Enabled: true
|
998
989
|
SafeAutoCorrect: false
|
999
990
|
EnforcedStyle: constant
|
1000
991
|
SupportedStyles:
|
@@ -1025,216 +1016,3 @@ RSpec/Yield:
|
|
1025
1016
|
Enabled: true
|
1026
1017
|
VersionAdded: '1.32'
|
1027
1018
|
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Yield
|
1028
|
-
|
1029
|
-
RSpec/Capybara:
|
1030
|
-
Enabled: true
|
1031
|
-
Include: *1
|
1032
|
-
Language: *2
|
1033
|
-
|
1034
|
-
RSpec/Capybara/CurrentPathExpectation:
|
1035
|
-
Description: Checks that no expectations are set on Capybara's `current_path`.
|
1036
|
-
Enabled: true
|
1037
|
-
VersionAdded: '1.18'
|
1038
|
-
VersionChanged: '2.0'
|
1039
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/CurrentPathExpectation
|
1040
|
-
|
1041
|
-
RSpec/Capybara/FeatureMethods:
|
1042
|
-
Description: Checks for consistent method usage in feature specs.
|
1043
|
-
Enabled: true
|
1044
|
-
EnabledMethods: []
|
1045
|
-
VersionAdded: '1.17'
|
1046
|
-
VersionChanged: '2.0'
|
1047
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods
|
1048
|
-
|
1049
|
-
RSpec/Capybara/MatchStyle:
|
1050
|
-
Description: Checks for usage of deprecated style methods.
|
1051
|
-
Enabled: pending
|
1052
|
-
VersionAdded: '2.17'
|
1053
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/MatchStyle
|
1054
|
-
|
1055
|
-
RSpec/Capybara/NegationMatcher:
|
1056
|
-
Description: Enforces use of `have_no_*` or `not_to` for negated expectations.
|
1057
|
-
Enabled: pending
|
1058
|
-
VersionAdded: '2.14'
|
1059
|
-
EnforcedStyle: not_to
|
1060
|
-
SupportedStyles:
|
1061
|
-
- have_no
|
1062
|
-
- not_to
|
1063
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/NegationMatcher
|
1064
|
-
|
1065
|
-
RSpec/Capybara/SpecificActions:
|
1066
|
-
Description: Checks for there is a more specific actions offered by Capybara.
|
1067
|
-
Enabled: pending
|
1068
|
-
VersionAdded: '2.14'
|
1069
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/SpecificActions
|
1070
|
-
|
1071
|
-
RSpec/Capybara/SpecificFinders:
|
1072
|
-
Description: Checks if there is a more specific finder offered by Capybara.
|
1073
|
-
Enabled: pending
|
1074
|
-
VersionAdded: '2.13'
|
1075
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/SpecificFinders
|
1076
|
-
|
1077
|
-
RSpec/Capybara/SpecificMatcher:
|
1078
|
-
Description: Checks for there is a more specific matcher offered by Capybara.
|
1079
|
-
Enabled: pending
|
1080
|
-
VersionAdded: '2.12'
|
1081
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/SpecificMatcher
|
1082
|
-
|
1083
|
-
RSpec/Capybara/VisibilityMatcher:
|
1084
|
-
Description: Checks for boolean visibility in Capybara finders.
|
1085
|
-
Enabled: true
|
1086
|
-
VersionAdded: '1.39'
|
1087
|
-
VersionChanged: '2.0'
|
1088
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/VisibilityMatcher
|
1089
|
-
|
1090
|
-
RSpec/FactoryBot:
|
1091
|
-
Enabled: true
|
1092
|
-
Include: *1
|
1093
|
-
Language: *2
|
1094
|
-
|
1095
|
-
RSpec/FactoryBot/AttributeDefinedStatically:
|
1096
|
-
Description: Always declare attribute values as blocks.
|
1097
|
-
Enabled: true
|
1098
|
-
Include:
|
1099
|
-
- "**/spec/factories.rb"
|
1100
|
-
- "**/spec/factories/**/*.rb"
|
1101
|
-
- "**/features/support/factories/**/*.rb"
|
1102
|
-
VersionAdded: '1.28'
|
1103
|
-
VersionChanged: '2.23'
|
1104
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/AttributeDefinedStatically
|
1105
|
-
|
1106
|
-
RSpec/FactoryBot/ConsistentParenthesesStyle:
|
1107
|
-
Description: Use a consistent style for parentheses in factory bot calls.
|
1108
|
-
Enabled: pending
|
1109
|
-
EnforcedStyle: require_parentheses
|
1110
|
-
SupportedStyles:
|
1111
|
-
- require_parentheses
|
1112
|
-
- omit_parentheses
|
1113
|
-
VersionAdded: '2.14'
|
1114
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/ConsistentParenthesesStyle
|
1115
|
-
|
1116
|
-
RSpec/FactoryBot/CreateList:
|
1117
|
-
Description: Checks for create_list usage.
|
1118
|
-
Enabled: true
|
1119
|
-
Include:
|
1120
|
-
- "**/*_spec.rb"
|
1121
|
-
- "**/spec/**/*"
|
1122
|
-
- "**/spec/factories.rb"
|
1123
|
-
- "**/spec/factories/**/*.rb"
|
1124
|
-
- "**/features/support/factories/**/*.rb"
|
1125
|
-
EnforcedStyle: create_list
|
1126
|
-
SupportedStyles:
|
1127
|
-
- create_list
|
1128
|
-
- n_times
|
1129
|
-
VersionAdded: '1.25'
|
1130
|
-
VersionChanged: '2.23'
|
1131
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList
|
1132
|
-
|
1133
|
-
RSpec/FactoryBot/FactoryClassName:
|
1134
|
-
Description: Use string value when setting the class attribute explicitly.
|
1135
|
-
Enabled: true
|
1136
|
-
Include:
|
1137
|
-
- "**/spec/factories.rb"
|
1138
|
-
- "**/spec/factories/**/*.rb"
|
1139
|
-
- "**/features/support/factories/**/*.rb"
|
1140
|
-
VersionAdded: '1.37'
|
1141
|
-
VersionChanged: '2.23'
|
1142
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName
|
1143
|
-
|
1144
|
-
RSpec/FactoryBot/FactoryNameStyle:
|
1145
|
-
Description: Checks for name style for argument of FactoryBot::Syntax::Methods.
|
1146
|
-
Enabled: pending
|
1147
|
-
VersionAdded: '2.16'
|
1148
|
-
EnforcedStyle: symbol
|
1149
|
-
SupportedStyles:
|
1150
|
-
- symbol
|
1151
|
-
- string
|
1152
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryNameStyle
|
1153
|
-
|
1154
|
-
RSpec/FactoryBot/SyntaxMethods:
|
1155
|
-
Description: Use shorthands from `FactoryBot::Syntax::Methods` in your specs.
|
1156
|
-
Enabled: pending
|
1157
|
-
SafeAutoCorrect: false
|
1158
|
-
VersionAdded: '2.7'
|
1159
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/SyntaxMethods
|
1160
|
-
|
1161
|
-
RSpec/Rails:
|
1162
|
-
Enabled: true
|
1163
|
-
Include: *1
|
1164
|
-
Language: *2
|
1165
|
-
|
1166
|
-
RSpec/Rails/AvoidSetupHook:
|
1167
|
-
Description: Checks that tests use RSpec `before` hook over Rails `setup` method.
|
1168
|
-
Enabled: pending
|
1169
|
-
VersionAdded: '2.4'
|
1170
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/AvoidSetupHook
|
1171
|
-
|
1172
|
-
RSpec/Rails/HaveHttpStatus:
|
1173
|
-
Description: Checks that tests use `have_http_status` instead of equality matchers.
|
1174
|
-
Enabled: pending
|
1175
|
-
ResponseMethods:
|
1176
|
-
- response
|
1177
|
-
- last_response
|
1178
|
-
SafeAutoCorrect: false
|
1179
|
-
VersionAdded: '2.12'
|
1180
|
-
VersionChanged: '2.27'
|
1181
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HaveHttpStatus
|
1182
|
-
|
1183
|
-
RSpec/Rails/HttpStatus:
|
1184
|
-
Description: Enforces use of symbolic or numeric value to describe HTTP status.
|
1185
|
-
Enabled: true
|
1186
|
-
EnforcedStyle: symbolic
|
1187
|
-
SupportedStyles:
|
1188
|
-
- numeric
|
1189
|
-
- symbolic
|
1190
|
-
- be_status
|
1191
|
-
VersionAdded: '1.23'
|
1192
|
-
VersionChanged: '2.20'
|
1193
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus
|
1194
|
-
|
1195
|
-
RSpec/Rails/InferredSpecType:
|
1196
|
-
Description: Identifies redundant spec type.
|
1197
|
-
Enabled: pending
|
1198
|
-
Safe: false
|
1199
|
-
VersionAdded: '2.14'
|
1200
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/InferredSpecType
|
1201
|
-
Inferences:
|
1202
|
-
channels: channel
|
1203
|
-
controllers: controller
|
1204
|
-
features: feature
|
1205
|
-
generator: generator
|
1206
|
-
helpers: helper
|
1207
|
-
jobs: job
|
1208
|
-
mailboxes: mailbox
|
1209
|
-
mailers: mailer
|
1210
|
-
models: model
|
1211
|
-
requests: request
|
1212
|
-
integration: request
|
1213
|
-
api: request
|
1214
|
-
routing: routing
|
1215
|
-
system: system
|
1216
|
-
views: view
|
1217
|
-
|
1218
|
-
RSpec/Rails/MinitestAssertions:
|
1219
|
-
Description: Check if using Minitest-like matchers.
|
1220
|
-
Enabled: pending
|
1221
|
-
VersionAdded: '2.17'
|
1222
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/MinitestAssertions
|
1223
|
-
|
1224
|
-
RSpec/Rails/NegationBeValid:
|
1225
|
-
Description: Enforces use of `be_invalid` or `not_to` for negated be_valid.
|
1226
|
-
Safe: false
|
1227
|
-
EnforcedStyle: not_to
|
1228
|
-
SupportedStyles:
|
1229
|
-
- not_to
|
1230
|
-
- be_invalid
|
1231
|
-
Enabled: pending
|
1232
|
-
VersionAdded: '2.23'
|
1233
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/NegationBeValid
|
1234
|
-
|
1235
|
-
RSpec/Rails/TravelAround:
|
1236
|
-
Description: Prefer to travel in `before` rather than `around`.
|
1237
|
-
Enabled: pending
|
1238
|
-
Safe: false
|
1239
|
-
VersionAdded: '2.19'
|
1240
|
-
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/TravelAround
|
data/config/obsoletion.yml
CHANGED
@@ -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
|
@@ -29,6 +29,19 @@ module RuboCop
|
|
29
29
|
# PreferredMethods:
|
30
30
|
# context: describe
|
31
31
|
#
|
32
|
+
# If you were previously using the `RSpec/Capybara/FeatureMethods` cop and
|
33
|
+
# want to keep disabling all Capybara-specific methods that have the same
|
34
|
+
# native RSpec method (e.g. are just aliases), use the following config:
|
35
|
+
#
|
36
|
+
# RSpec/Dialect:
|
37
|
+
# PreferredMethods:
|
38
|
+
# background: :before
|
39
|
+
# scenario: :it
|
40
|
+
# xscenario: :xit
|
41
|
+
# given: :let
|
42
|
+
# given!: :let!
|
43
|
+
# feature: :describe
|
44
|
+
#
|
32
45
|
# You can expect the following behavior:
|
33
46
|
#
|
34
47
|
# @example
|
@@ -27,7 +27,7 @@ module RuboCop
|
|
27
27
|
# @!method expectation(node)
|
28
28
|
def_node_search :expectation, '(send nil? #Expectations.all ...)'
|
29
29
|
|
30
|
-
def on_block(node)
|
30
|
+
def on_block(node)
|
31
31
|
return unless hook?(node)
|
32
32
|
return if node.body.nil?
|
33
33
|
|
@@ -22,7 +22,7 @@ module RuboCop
|
|
22
22
|
# @!method expectation(node)
|
23
23
|
def_node_search :expectation, '(send nil? #Expectations.all ...)'
|
24
24
|
|
25
|
-
def on_block(node)
|
25
|
+
def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
|
26
26
|
return unless let?(node)
|
27
27
|
return if node.body.nil?
|
28
28
|
|
@@ -31,8 +31,6 @@ module RuboCop
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
alias on_numblock on_block
|
35
|
-
|
36
34
|
private
|
37
35
|
|
38
36
|
def message(expect)
|