rubocop-rspec 2.29.2 → 3.0.5

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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/README.md +14 -1
  4. data/config/default.yml +62 -264
  5. data/config/obsoletion.yml +15 -21
  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/example_wording.rb +2 -2
  9. data/lib/rubocop/cop/rspec/expect_actual.rb +1 -1
  10. data/lib/rubocop/cop/rspec/expect_in_hook.rb +1 -1
  11. data/lib/rubocop/cop/rspec/expect_in_let.rb +42 -0
  12. data/lib/rubocop/cop/rspec/indexed_let.rb +4 -3
  13. data/lib/rubocop/cop/rspec/leaky_constant_declaration.rb +1 -1
  14. data/lib/rubocop/cop/rspec/metadata_style.rb +1 -6
  15. data/lib/rubocop/cop/rspec/missing_expectation_target_method.rb +54 -0
  16. data/lib/rubocop/cop/rspec/multiple_describes.rb +1 -1
  17. data/lib/rubocop/cop/rspec/multiple_expectations.rb +4 -4
  18. data/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb +4 -5
  19. data/lib/rubocop/cop/rspec/named_subject.rb +5 -2
  20. data/lib/rubocop/cop/rspec/nested_groups.rb +2 -1
  21. data/lib/rubocop/cop/rspec/predicate_matcher.rb +8 -4
  22. data/lib/rubocop/cop/rspec/remove_const.rb +0 -1
  23. data/lib/rubocop/cop/rspec/scattered_setup.rb +7 -1
  24. data/lib/rubocop/cop/rspec/sort_metadata.rb +1 -1
  25. data/lib/rubocop/cop/rspec/stubbed_mock.rb +3 -1
  26. data/lib/rubocop/cop/rspec/subject_stub.rb +2 -2
  27. data/lib/rubocop/cop/rspec/unspecified_exception.rb +20 -15
  28. data/lib/rubocop/cop/rspec_cops.rb +2 -25
  29. data/lib/rubocop/rspec/concept.rb +0 -1
  30. data/lib/rubocop/rspec/config_formatter.rb +1 -24
  31. data/lib/rubocop/rspec/cop/generator.rb +25 -0
  32. data/lib/rubocop/rspec/language.rb +0 -1
  33. data/lib/rubocop/rspec/shared_contexts/default_rspec_language_config_context.rb +1 -1
  34. data/lib/rubocop/rspec/version.rb +1 -1
  35. data/lib/rubocop/rspec/wording.rb +2 -2
  36. data/lib/rubocop-rspec.rb +1 -17
  37. metadata +8 -70
  38. data/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb +0 -39
  39. data/lib/rubocop/cop/rspec/capybara/feature_methods.rb +0 -104
  40. data/lib/rubocop/cop/rspec/capybara/match_style.rb +0 -38
  41. data/lib/rubocop/cop/rspec/capybara/negation_matcher.rb +0 -33
  42. data/lib/rubocop/cop/rspec/capybara/specific_actions.rb +0 -29
  43. data/lib/rubocop/cop/rspec/capybara/specific_finders.rb +0 -24
  44. data/lib/rubocop/cop/rspec/capybara/specific_matcher.rb +0 -35
  45. data/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb +0 -36
  46. data/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb +0 -35
  47. data/lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb +0 -50
  48. data/lib/rubocop/cop/rspec/factory_bot/create_list.rb +0 -40
  49. data/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb +0 -29
  50. data/lib/rubocop/cop/rspec/factory_bot/factory_name_style.rb +0 -33
  51. data/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb +0 -55
  52. data/lib/rubocop/cop/rspec/file_path.rb +0 -179
  53. data/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb +0 -27
  54. data/lib/rubocop/cop/rspec/rails/have_http_status.rb +0 -35
  55. data/lib/rubocop/cop/rspec/rails/http_status.rb +0 -61
  56. data/lib/rubocop/cop/rspec/rails/inferred_spec_type.rb +0 -62
  57. data/lib/rubocop/cop/rspec/rails/minitest_assertions.rb +0 -39
  58. data/lib/rubocop/cop/rspec/rails/negation_be_valid.rb +0 -39
  59. data/lib/rubocop/cop/rspec/rails/travel_around.rb +0 -34
  60. 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: 6ce22630f88fd7a9b996711a4af330a186471fdc8a6dd99b05830ad695a09118
4
+ data.tar.gz: 44a91f15e435ec623b2a25ae6e7b890772d7cf3066206f97b0ca1abf42c62c7a
5
5
  SHA512:
6
- metadata.gz: 202e33ab3927087a3e59917c1a73edc28f13054e668bbefeb5451799f373304b0a5d703e3a0564cf72df2f8afe86d0be1b5a1ffc06bfe2f145c4b2645474a653
7
- data.tar.gz: ad0cb220b35590ffc7911e149d9754af5185b83fe597a2212a4dca2927617f4269af80f19cfeabd147e2b06181c9ce37a44998822d9a3f2fd7c27395fca18b0d
6
+ metadata.gz: 0d6b6f4113c4fc5253dcd59525e348879ae5763d09bb416de752d037b3ee20c38774df54322a8c7abd4c21652b22e6c4ac708bce51a2f1df61fecb4aab9dc4ac
7
+ data.tar.gz: ec0278b64e0dc0ca9cf0e9558ae02224ea5a3360ee86380336b4bc07e134801e46011f5ef673586eac6b85557884b3d3986d05935b3255ba48c227ecd760227c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,51 @@
2
2
 
3
3
  ## Master (Unreleased)
4
4
 
5
+ ## 3.0.5 (2024-09-07)
6
+
7
+ - Fix false-negative and error for `RSpec/MetadataStyle` when non-literal args are used in metadata in `EnforceStyle: hash`. ([@cbliard])
8
+ - Improve offense message for `RSpec/IndexedLet`. ([@earlopain])
9
+
10
+ ## 3.0.4 (2024-08-05)
11
+
12
+ - Fix false-negative for `UnspecifiedException` when matcher is chained. ([@r7kamura])
13
+
14
+ ## 3.0.3 (2024-07-12)
15
+
16
+ - Add support for Unicode RIGHT SINGLE QUOTATION MARK in `RSpec/ExampleWording`. ([@jdufresne])
17
+ - Suppress deprecation warning for `RSpec/MultipleExpectations`, `RSpec/MultipleMemoizedHelpers`, and `RSpec/NestedGroups` cops. ([@koic])
18
+
19
+ ## 3.0.2 (2024-07-02)
20
+
21
+ - Fix wrong autocorrect for `RSpec/ScatteredSetup` when hook contains heredoc. ([@earlopain])
22
+ - Fix false negative for `RSpec/PredicateMatcher` when expectation contains custom failure message. ([@earlopain])
23
+ - Facilitate the 3.0 upgrade flow with proper extracted cop messages. ([@jeppester])
24
+
25
+ ## 3.0.1 (2024-06-11)
26
+
27
+ - Bump RuboCop requirement to +1.61. ([@ydah])
28
+
29
+ ## 3.0.0 (2024-06-11)
30
+
31
+ - Remove extracted cops in `Capybara`, `FactoryBot` and `Rails` departments. ([@ydah])
32
+ - Remove `RuboCop::RSpec::Language::NodePattern`. ([@ydah])
33
+ - Remove `RSpec/FilePath` cop. ([@ydah])
34
+ - Remove `RSpec/Capybara/FeatureMethods` cop. If you are using this cop, change it to use `RSpec/Dialect`. ([@ydah])
35
+ - Add new `RSpec/MissingExpectationTargetMethod` cop. ([@krororo])
36
+ - Fix an error for `RSpec/ScatteredSetup` when one of the hooks is an empty block. ([@earlopain])
37
+
38
+ 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`.
39
+
40
+ Read more about how to upgrade in https://docs.rubocop.org/rubocop-rspec/upgrade_to_version_3.html
41
+
42
+ ## 2.31.0 (2024-06-07)
43
+
44
+ - Support `AutoCorrect: contextual` option for LSP. ([@ydah])
45
+
46
+ ## 2.30.0 (2024-06-03)
47
+
48
+ - Add new `RSpec/ExpectInLet` cop. ([@yasu551])
49
+
5
50
  ## 2.29.2 (2024-05-02)
6
51
 
7
52
  - Fix beginless and endless range bug for RepeatedIncludeExample cop. ([@hasghari])
@@ -871,6 +916,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
871
916
  [@bquorning]: https://github.com/bquorning
872
917
  [@brentwheeldon]: https://github.com/BrentWheeldon
873
918
  [@brianhawley]: https://github.com/BrianHawley
919
+ [@cbliard]: https://github.com/cbliard
874
920
  [@cfabianski]: https://github.com/cfabianski
875
921
  [@clupprich]: https://github.com/clupprich
876
922
  [@composerinteralia]: https://github.com/composerinteralia
@@ -885,6 +931,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
885
931
  [@drowze]: https://github.com/Drowze
886
932
  [@dswij]: https://github.com/dswij
887
933
  [@dvandersluis]: https://github.com/dvandersluis
934
+ [@earlopain]: https://github.com/earlopain
888
935
  [@edgibbs]: https://github.com/edgibbs
889
936
  [@eikes]: https://github.com/eikes
890
937
  [@eitoball]: https://github.com/eitoball
@@ -907,6 +954,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
907
954
  [@jaredmoody]: https://github.com/jaredmoody
908
955
  [@jdufresne]: https://github.com/jdufresne
909
956
  [@jeffreyc]: https://github.com/jeffreyc
957
+ [@jeppester]: https://github.com/jeppester
910
958
  [@jessieay]: https://github.com/jessieay
911
959
  [@jfragoulis]: https://github.com/jfragoulis
912
960
  [@johnny-miyake]: https://github.com/johnny-miyake
@@ -916,6 +964,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
916
964
  [@k-s-a]: https://github.com/K-S-A
917
965
  [@kellysutton]: https://github.com/kellysutton
918
966
  [@koic]: https://github.com/koic
967
+ [@krororo]: https://github.com/krororo
919
968
  [@kuahyeow]: https://github.com/kuahyeow
920
969
  [@lazycoder9]: https://github.com/lazycoder9
921
970
  [@leoarnold]: https://github.com/leoarnold
@@ -976,6 +1025,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
976
1025
  [@twalpole]: https://github.com/twalpole
977
1026
  [@vzvu3k6k]: https://github.com/vzvu3k6k
978
1027
  [@walf443]: https://github.com/walf443
1028
+ [@yasu551]: https://github.com/yasu551
979
1029
  [@ybiquitous]: https://github.com/ybiquitous
980
1030
  [@ydah]: https://github.com/ydah
981
1031
  [@yevhene]: https://github.com/yevhene
data/README.md CHANGED
@@ -7,6 +7,15 @@
7
7
  [RSpec](https://rspec.info/)-specific analysis for your projects, as an extension to
8
8
  [RuboCop](https://github.com/rubocop/rubocop).
9
9
 
10
+ - [Installation](#installation)
11
+ - [Upgrading to RuboCop RSpec v3.x](#upgrading-to-rubocop-rspec-v3x)
12
+ - [Upgrading to RuboCop RSpec v2.x](#upgrading-to-rubocop-rspec-v2x)
13
+ - [Usage](#usage)
14
+ - [Documentation](#documentation)
15
+ - [The Cops](#the-cops)
16
+ - [Contributing](#contributing)
17
+ - [License](#license)
18
+
10
19
  ## Installation
11
20
 
12
21
  Just install the `rubocop-rspec` gem
@@ -21,6 +30,10 @@ or if you use bundler put this in your `Gemfile`
21
30
  gem 'rubocop-rspec', require: false
22
31
  ```
23
32
 
33
+ ### Upgrading to RuboCop RSpec v3.x
34
+
35
+ Read all the details in our [Upgrade to Version 3.x](https://docs.rubocop.org/rubocop-rspec/3.0/upgrade_to_version_3.html) document.
36
+
24
37
  ### Upgrading to RuboCop RSpec v2.x
25
38
 
26
39
  Read all the details in our [Upgrade to Version 2.x](https://docs.rubocop.org/rubocop-rspec/2.0/upgrade_to_version_2.html) document.
@@ -81,7 +94,7 @@ In your `.rubocop.yml`, you may treat the RSpec cops just like any other
81
94
  cop. For example:
82
95
 
83
96
  ```yaml
84
- RSpec/FilePath:
97
+ RSpec/SpecFilePathFormat:
85
98
  Exclude:
86
99
  - spec/my_poorly_named_spec_file.rb
87
100
  ```