rubocop-rspec 2.0.0.pre → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -2
  3. data/README.md +7 -3
  4. data/config/default.yml +159 -73
  5. data/lib/rubocop-rspec.rb +8 -8
  6. data/lib/rubocop/cop/rspec/align_left_let_brace.rb +7 -3
  7. data/lib/rubocop/cop/rspec/align_right_let_brace.rb +7 -3
  8. data/lib/rubocop/cop/rspec/any_instance.rb +6 -10
  9. data/lib/rubocop/cop/rspec/around_block.rb +3 -1
  10. data/lib/rubocop/cop/rspec/base.rb +6 -55
  11. data/lib/rubocop/cop/rspec/be.rb +3 -2
  12. data/lib/rubocop/cop/rspec/be_eql.rb +2 -0
  13. data/lib/rubocop/cop/rspec/before_after_all.rb +6 -3
  14. data/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb +7 -2
  15. data/lib/rubocop/cop/rspec/capybara/feature_methods.rb +6 -2
  16. data/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb +4 -0
  17. data/lib/rubocop/cop/rspec/context_method.rb +1 -0
  18. data/lib/rubocop/cop/rspec/context_wording.rb +7 -1
  19. data/lib/rubocop/cop/rspec/describe_class.rb +5 -2
  20. data/lib/rubocop/cop/rspec/describe_method.rb +3 -2
  21. data/lib/rubocop/cop/rspec/describe_symbol.rb +2 -0
  22. data/lib/rubocop/cop/rspec/described_class.rb +6 -2
  23. data/lib/rubocop/cop/rspec/described_class_module_wrapping.rb +3 -3
  24. data/lib/rubocop/cop/rspec/dialect.rb +2 -1
  25. data/lib/rubocop/cop/rspec/empty_example_group.rb +6 -45
  26. data/lib/rubocop/cop/rspec/empty_hook.rb +2 -1
  27. data/lib/rubocop/cop/rspec/empty_line_after_example.rb +1 -1
  28. data/lib/rubocop/cop/rspec/empty_line_after_example_group.rb +1 -1
  29. data/lib/rubocop/cop/rspec/empty_line_after_final_let.rb +1 -1
  30. data/lib/rubocop/cop/rspec/empty_line_after_hook.rb +1 -1
  31. data/lib/rubocop/cop/rspec/empty_line_after_subject.rb +2 -2
  32. data/lib/rubocop/cop/rspec/example_length.rb +26 -12
  33. data/lib/rubocop/cop/rspec/example_without_description.rb +1 -0
  34. data/lib/rubocop/cop/rspec/example_wording.rb +1 -0
  35. data/lib/rubocop/cop/rspec/expect_actual.rb +3 -1
  36. data/lib/rubocop/cop/rspec/expect_change.rb +3 -0
  37. data/lib/rubocop/cop/rspec/expect_in_hook.rb +2 -1
  38. data/lib/rubocop/cop/rspec/expect_output.rb +1 -1
  39. data/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb +3 -0
  40. data/lib/rubocop/cop/rspec/factory_bot/create_list.rb +4 -0
  41. data/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb +2 -0
  42. data/lib/rubocop/cop/rspec/file_path.rb +26 -17
  43. data/lib/rubocop/cop/rspec/focus.rb +46 -8
  44. data/lib/rubocop/cop/rspec/hook_argument.rb +4 -4
  45. data/lib/rubocop/cop/rspec/hooks_before_examples.rb +3 -2
  46. data/lib/rubocop/cop/rspec/implicit_block_expectation.rb +4 -0
  47. data/lib/rubocop/cop/rspec/implicit_expect.rb +2 -1
  48. data/lib/rubocop/cop/rspec/implicit_subject.rb +2 -0
  49. data/lib/rubocop/cop/rspec/instance_spy.rb +3 -1
  50. data/lib/rubocop/cop/rspec/instance_variable.rb +5 -1
  51. data/lib/rubocop/cop/rspec/it_behaves_like.rb +3 -1
  52. data/lib/rubocop/cop/rspec/iterated_expectation.rb +3 -1
  53. data/lib/rubocop/cop/rspec/let_before_examples.rb +3 -2
  54. data/lib/rubocop/cop/rspec/let_setup.rb +10 -4
  55. data/lib/rubocop/cop/rspec/message_chain.rb +4 -10
  56. data/lib/rubocop/cop/rspec/message_expectation.rb +3 -0
  57. data/lib/rubocop/cop/rspec/message_spies.rb +5 -3
  58. data/lib/rubocop/cop/rspec/mixin/comments_help.rb +38 -0
  59. data/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb +51 -0
  60. data/lib/rubocop/cop/rspec/mixin/final_end_location.rb +19 -0
  61. data/lib/rubocop/cop/rspec/mixin/top_level_group.rb +54 -0
  62. data/lib/rubocop/cop/rspec/mixin/variable.rb +21 -0
  63. data/lib/rubocop/cop/rspec/multiple_describes.rb +2 -3
  64. data/lib/rubocop/cop/rspec/multiple_expectations.rb +4 -1
  65. data/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb +3 -1
  66. data/lib/rubocop/cop/rspec/named_subject.rb +11 -12
  67. data/lib/rubocop/cop/rspec/nested_groups.rb +1 -1
  68. data/lib/rubocop/cop/rspec/not_to_not.rb +2 -0
  69. data/lib/rubocop/cop/rspec/overwriting_setup.rb +4 -1
  70. data/lib/rubocop/cop/rspec/pending.rb +17 -5
  71. data/lib/rubocop/cop/rspec/predicate_matcher.rb +8 -3
  72. data/lib/rubocop/cop/rspec/rails/http_status.rb +2 -0
  73. data/lib/rubocop/cop/rspec/receive_counts.rb +4 -0
  74. data/lib/rubocop/cop/rspec/receive_never.rb +2 -0
  75. data/lib/rubocop/cop/rspec/repeated_example_group_body.rb +8 -1
  76. data/lib/rubocop/cop/rspec/repeated_example_group_description.rb +4 -0
  77. data/lib/rubocop/cop/rspec/repeated_include_example.rb +6 -2
  78. data/lib/rubocop/cop/rspec/return_from_stub.rb +6 -0
  79. data/lib/rubocop/cop/rspec/scattered_setup.rb +1 -1
  80. data/lib/rubocop/cop/rspec/shared_context.rb +22 -11
  81. data/lib/rubocop/cop/rspec/shared_examples.rb +4 -1
  82. data/lib/rubocop/cop/rspec/single_argument_message_chain.rb +4 -1
  83. data/lib/rubocop/cop/rspec/stubbed_mock.rb +2 -1
  84. data/lib/rubocop/cop/rspec/subject_stub.rb +17 -6
  85. data/lib/rubocop/cop/rspec/unspecified_exception.rb +2 -0
  86. data/lib/rubocop/cop/rspec/variable_definition.rb +1 -1
  87. data/lib/rubocop/cop/rspec/variable_name.rb +1 -1
  88. data/lib/rubocop/cop/rspec/verified_doubles.rb +2 -0
  89. data/lib/rubocop/cop/rspec/void_expect.rb +3 -0
  90. data/lib/rubocop/cop/rspec/yield.rb +3 -0
  91. data/lib/rubocop/cop/rspec_cops.rb +0 -1
  92. data/lib/rubocop/rspec/align_let_brace.rb +1 -1
  93. data/lib/rubocop/rspec/concept.rb +2 -2
  94. data/lib/rubocop/rspec/config_formatter.rb +5 -3
  95. data/lib/rubocop/rspec/corrector/move_node.rb +7 -10
  96. data/lib/rubocop/rspec/example.rb +5 -0
  97. data/lib/rubocop/rspec/example_group.rb +15 -5
  98. data/lib/rubocop/rspec/hook.rb +2 -1
  99. data/lib/rubocop/rspec/inject.rb +4 -2
  100. data/lib/rubocop/rspec/language.rb +159 -115
  101. data/lib/rubocop/rspec/language/node_pattern.rb +7 -24
  102. data/lib/rubocop/rspec/node.rb +1 -1
  103. data/lib/rubocop/rspec/version.rb +1 -1
  104. metadata +27 -16
  105. data/lib/rubocop/cop/rspec/cop.rb +0 -10
  106. data/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb +0 -41
  107. data/lib/rubocop/rspec.rb +0 -12
  108. data/lib/rubocop/rspec/empty_line_separation.rb +0 -48
  109. data/lib/rubocop/rspec/final_end_location.rb +0 -17
  110. data/lib/rubocop/rspec/top_level_describe.rb +0 -52
  111. data/lib/rubocop/rspec/top_level_group.rb +0 -57
  112. data/lib/rubocop/rspec/variable.rb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0940bab64e9ccca8168ff22b5d0f46e6777d015316da687deca6072f0e8c25f0'
4
- data.tar.gz: c7a518dbbcbcb63567b4491849a8ef79834051350614a8b8bf284f7f8a31f83d
3
+ metadata.gz: 4a953b5fa50cd545314cbe25e453b476b670cd2a4eb2d60c75109354ed7c333c
4
+ data.tar.gz: be5782eb1c0f8e4ca86b28ed39fba908719afe73dd544a161885719485853a89
5
5
  SHA512:
6
- metadata.gz: 9f8b127bdccb77c1f85268adc1cd60f614423914f5889557e71b59a36b040e8dc8c42ad409b4310dd039d5621f928bac3f60293d07e6f419762c02ddfbd5ddb0
7
- data.tar.gz: 23922bf8587a2ac38a1bf76b973ba64ec586cf0ea6d32f65602257fd9782ddc8d4553ff964f9ff833c423e19bdb59f733593ca91539ecab709e0b6b29bf3ae53
6
+ metadata.gz: e859b8c055f4502d3156595c8293decfe10883a6bea0f61a21558b9acc771b1231699439611a3da3ccb0841495ad7c1a5af3ec1c6d3e948fbb29b70a0b77289d
7
+ data.tar.gz: a817dcdbcd1850d4888f4d5fc58837a1c8c59fa754f10dff0aa3eebf24013e88230d84719592115b3339551ac2c932240d01bac1b8a5094982943f1a9e960908
data/CHANGELOG.md CHANGED
@@ -1,11 +1,42 @@
1
- # Change log
1
+ # Changelog
2
2
 
3
3
  ## Master (Unreleased)
4
4
 
5
+ ## 2.3.0 (2021-04-28)
6
+
7
+ * Allow `RSpec/ContextWording` to accept multi-word prefixes. ([@hosamaly][])
8
+ * Drop support for ruby 2.4. ([@bquorning][])
9
+ * Add `CountAsOne` configuration option to `RSpec/ExampleLength`. ([@stephannv][])
10
+ * Fix a false positive for `RSpec/RepeatedExampleGroupBody` when `pending` or `skip` have argument(s). ([@Tietew][])
11
+
12
+ ## 2.2.0 (2021-02-02)
13
+
14
+ * Fix `HooksBeforeExamples`, `LeadingSubject`, `LetBeforeExamples` and `ScatteredLet` autocorrection to take into account inline comments and comments immediately before the moved node. ([@Darhazer][])
15
+ * Improve rubocop-rspec performance. ([@Darhazer][], [@bquorning][])
16
+ * Include `Enabled: true` to prevent a mismatched configuration parameter warning when `RSpec` cops are explicitly enabled in the user configuration. ([@pirj][])
17
+
18
+ ## 2.1.0 (2020-12-17)
19
+
20
+ * Fix `RSpec/FilePath` false positive for relative file path runs with long namespaces. ([@ahukkanen][])
21
+ * Update `RSpec/Focus` to have auto-correction. ([@dvandersluis][])
22
+
23
+ ## 2.0.1 (2020-12-02)
24
+
25
+ * Fixed infinite loop in `RSpec/ExpectActual` autocorrection when both expected and actual values are literals. ([@Darhazer][])
26
+
27
+ ## 2.0.0 (2020-11-06)
28
+
29
+ * Remove deprecated class `::RuboCop::Cop::RSpec::Cop`. ([@bquorning][])
30
+ * Retire `RSpec/InvalidPredicateMatcher` cop. ([@pirj][])
31
+ * Remove the code responsible for filtering files to inspect. ([@pirj][])
32
+ * Make RSpec language elements configurable. ([@sl4vr][])
33
+ * Remove `CustomIncludeMethods` `RSpec/EmptyExampleGroup` option in favour of the new RSpec DSL configuration. ([@pirj][])
34
+ * Enabled pending cop (`RSpec/StubbedMock`). ([@pirj][])
35
+
5
36
  ## 2.0.0.pre (2020-10-22)
6
37
 
7
38
  * Update RuboCop dependency to v1.0.0. ([@bquorning][])
8
- * **(Potentially breaking)** Change namespace of several cops (`Capybara/*` -> `RSpec/Capybara/*`, `FactoryBot/*` -> `RSpec/FactoryBot/*`, `Rails/*` -> `RSpec/Rails/*`). ([@pirj][], [@bquorning][])
39
+ * Change namespace of several cops (`Capybara/*` -> `RSpec/Capybara/*`, `FactoryBot/*` -> `RSpec/FactoryBot/*`, `Rails/*` -> `RSpec/Rails/*`). ([@pirj][], [@bquorning][])
9
40
 
10
41
  ## 1.44.1 (2020-10-20)
11
42
 
@@ -576,3 +607,9 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
576
607
  [@koic]: https://github.com/koic
577
608
  [@Rafix02]: https://github.com/Rafix02
578
609
  [@PhilCoggins]: https://github.com/PhilCoggins
610
+ [@sl4vr]: https://github.com/sl4vr
611
+ [@ahukkanen]: https://github.com/ahukkanen
612
+ [@dvandersluis]: https://github.com/dvandersluis
613
+ [@hosamaly]: https://github.com/hosamaly
614
+ [@stephannv]: https://github.com/stephannv
615
+ [@Tietew]: https://github.com/Tietew
data/README.md CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  [![Join the chat at https://gitter.im/rubocop-rspec/Lobby](https://badges.gitter.im/rubocop-rspec/Lobby.svg)](https://gitter.im/rubocop-rspec/Lobby)
4
4
  [![Gem Version](https://badge.fury.io/rb/rubocop-rspec.svg)](https://rubygems.org/gems/rubocop-rspec)
5
- [![CircleCI](https://circleci.com/gh/rubocop-hq/rubocop-rspec.svg?style=svg)](https://circleci.com/gh/rubocop-hq/rubocop-rspec)
5
+ [![CircleCI](https://circleci.com/gh/rubocop/rubocop-rspec.svg?style=svg)](https://circleci.com/gh/rubocop/rubocop-rspec)
6
6
  [![Test Coverage](https://api.codeclimate.com/v1/badges/8ffaabf633c968c22bdd/test_coverage)](https://codeclimate.com/github/rubocop-hq/rubocop-rspec/test_coverage)
7
7
  [![Maintainability](https://api.codeclimate.com/v1/badges/8ffaabf633c968c22bdd/maintainability)](https://codeclimate.com/github/rubocop-hq/rubocop-rspec/maintainability)
8
8
 
9
9
  RSpec-specific analysis for your projects, as an extension to
10
- [RuboCop](https://github.com/rubocop-hq/rubocop).
10
+ [RuboCop](https://github.com/rubocop/rubocop).
11
11
 
12
12
  ## Installation
13
13
 
@@ -23,6 +23,10 @@ or if you use bundler put this in your `Gemfile`
23
23
  gem 'rubocop-rspec', require: false
24
24
  ```
25
25
 
26
+ ### Upgrading to RuboCop RSpec v2.x
27
+
28
+ 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.
29
+
26
30
  ## Usage
27
31
 
28
32
  You need to tell RuboCop to load the RSpec extension. There are three
@@ -67,7 +71,7 @@ rubocop-rspec is available on Code Climate as part of the rubocop engine. [Learn
67
71
 
68
72
  ## Documentation
69
73
 
70
- You can read more about RuboCop-RSpec in its [official manual](https://docs.rubocop.org/rubocop-rspec).
74
+ You can read more about RuboCop RSpec in its [official manual](https://docs.rubocop.org/rubocop-rspec).
71
75
 
72
76
  ## The Cops
73
77
 
data/config/default.yml CHANGED
@@ -1,14 +1,86 @@
1
1
  ---
2
- AllCops:
3
- RSpec:
4
- Patterns:
5
- - _spec.rb
6
- - "(?:^|/)spec/"
7
- RSpec/FactoryBot:
8
- Patterns:
9
- - spec/factories.rb
10
- - spec/factories/**/*.rb
11
- - features/support/factories/**/*.rb
2
+ RSpec:
3
+ Enabled: true
4
+ Include:
5
+ - "**/*_spec.rb"
6
+ - "**/spec/**/*"
7
+ Language:
8
+ ExampleGroups:
9
+ Regular:
10
+ - describe
11
+ - context
12
+ - feature
13
+ - example_group
14
+ Skipped:
15
+ - xdescribe
16
+ - xcontext
17
+ - xfeature
18
+ Focused:
19
+ - fdescribe
20
+ - fcontext
21
+ - ffeature
22
+ Examples:
23
+ Regular:
24
+ - it
25
+ - specify
26
+ - example
27
+ - scenario
28
+ - its
29
+ Focused:
30
+ - fit
31
+ - fspecify
32
+ - fexample
33
+ - fscenario
34
+ - focus
35
+ Skipped:
36
+ - xit
37
+ - xspecify
38
+ - xexample
39
+ - xscenario
40
+ - skip
41
+ Pending:
42
+ - pending
43
+ Expectations:
44
+ - expect
45
+ - is_expected
46
+ - expect_any_instance_of
47
+ Helpers:
48
+ - let
49
+ - let!
50
+ Hooks:
51
+ - prepend_before
52
+ - before
53
+ - append_before
54
+ - around
55
+ - prepend_after
56
+ - after
57
+ - append_after
58
+ HookScopes:
59
+ - each
60
+ - example
61
+ - context
62
+ - all
63
+ - suite
64
+ Includes:
65
+ Examples:
66
+ - it_behaves_like
67
+ - it_should_behave_like
68
+ - include_examples
69
+ Context:
70
+ - include_context
71
+ Runners:
72
+ - to
73
+ - to_not
74
+ - not_to
75
+ SharedGroups:
76
+ Examples:
77
+ - shared_examples
78
+ - shared_examples_for
79
+ Context:
80
+ - shared_context
81
+ Subjects:
82
+ - subject
83
+ - subject!
12
84
 
13
85
  RSpec/AlignLeftLetBrace:
14
86
  Description: Checks that left braces for adjacent single line lets are aligned.
@@ -50,9 +122,9 @@ RSpec/BeforeAfterAll:
50
122
  Description: Check that before/after(:all) isn't being used.
51
123
  Enabled: true
52
124
  Exclude:
53
- - spec/spec_helper.rb
54
- - spec/rails_helper.rb
55
- - spec/support/**/*.rb
125
+ - spec/spec_helper.rb
126
+ - spec/rails_helper.rb
127
+ - spec/support/**/*.rb
56
128
  VersionAdded: '1.12'
57
129
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeforeAfterAll
58
130
 
@@ -66,9 +138,9 @@ RSpec/ContextWording:
66
138
  Description: Checks that `context` docstring starts with an allowed prefix.
67
139
  Enabled: true
68
140
  Prefixes:
69
- - when
70
- - with
71
- - without
141
+ - when
142
+ - with
143
+ - without
72
144
  VersionAdded: '1.20'
73
145
  VersionChanged: 1.20.1
74
146
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextWording
@@ -78,19 +150,19 @@ RSpec/DescribeClass:
78
150
  Enabled: true
79
151
  IgnoredMetadata:
80
152
  type:
81
- - channel
82
- - controller
83
- - helper
84
- - job
85
- - mailer
86
- - model
87
- - request
88
- - routing
89
- - view
90
- - feature
91
- - system
92
- - mailbox
93
- - aruba
153
+ - channel
154
+ - controller
155
+ - helper
156
+ - job
157
+ - mailer
158
+ - model
159
+ - request
160
+ - routing
161
+ - view
162
+ - feature
163
+ - system
164
+ - mailbox
165
+ - aruba
94
166
  VersionAdded: '1.0'
95
167
  VersionChanged: '1.44'
96
168
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass
@@ -113,8 +185,8 @@ RSpec/DescribedClass:
113
185
  SkipBlocks: false
114
186
  EnforcedStyle: described_class
115
187
  SupportedStyles:
116
- - described_class
117
- - explicit
188
+ - described_class
189
+ - explicit
118
190
  SafeAutoCorrect: false
119
191
  VersionAdded: '1.0'
120
192
  VersionChanged: '1.11'
@@ -136,8 +208,8 @@ RSpec/Dialect:
136
208
  RSpec/EmptyExampleGroup:
137
209
  Description: Checks if an example group does not include any tests.
138
210
  Enabled: true
139
- CustomIncludeMethods: []
140
211
  VersionAdded: '1.7'
212
+ VersionChanged: '2.0'
141
213
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyExampleGroup
142
214
 
143
215
  RSpec/EmptyHook:
@@ -181,7 +253,9 @@ RSpec/ExampleLength:
181
253
  Description: Checks for long examples.
182
254
  Enabled: true
183
255
  Max: 5
256
+ CountAsOne: []
184
257
  VersionAdded: '1.5'
258
+ VersionChanged: '2.3'
185
259
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleLength
186
260
 
187
261
  RSpec/ExampleWithoutDescription:
@@ -189,9 +263,9 @@ RSpec/ExampleWithoutDescription:
189
263
  Enabled: true
190
264
  EnforcedStyle: always_allow
191
265
  SupportedStyles:
192
- - always_allow
193
- - single_line_only
194
- - disallow
266
+ - always_allow
267
+ - single_line_only
268
+ - disallow
195
269
  VersionAdded: '1.22'
196
270
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWithoutDescription
197
271
 
@@ -212,7 +286,7 @@ RSpec/ExpectActual:
212
286
  Description: Checks for `expect(...)` calls containing literal values.
213
287
  Enabled: true
214
288
  Exclude:
215
- - spec/routing/**/*
289
+ - spec/routing/**/*
216
290
  VersionAdded: '1.7'
217
291
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectActual
218
292
 
@@ -221,8 +295,8 @@ RSpec/ExpectChange:
221
295
  Enabled: true
222
296
  EnforcedStyle: method_call
223
297
  SupportedStyles:
224
- - method_call
225
- - block
298
+ - method_call
299
+ - block
226
300
  VersionAdded: '1.22'
227
301
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectChange
228
302
 
@@ -241,6 +315,9 @@ RSpec/ExpectOutput:
241
315
  RSpec/FilePath:
242
316
  Description: Checks that spec file paths are consistent and well-formed.
243
317
  Enabled: true
318
+ Include:
319
+ - "**/*_spec*rb*"
320
+ - "**/spec/**/*"
244
321
  CustomTransform:
245
322
  RuboCop: rubocop
246
323
  RSpec: rspec
@@ -254,6 +331,7 @@ RSpec/Focus:
254
331
  Description: Checks if examples are focused.
255
332
  Enabled: true
256
333
  VersionAdded: '1.5'
334
+ VersionChanged: '2.1'
257
335
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Focus
258
336
 
259
337
  RSpec/HookArgument:
@@ -261,9 +339,9 @@ RSpec/HookArgument:
261
339
  Enabled: true
262
340
  EnforcedStyle: implicit
263
341
  SupportedStyles:
264
- - implicit
265
- - each
266
- - example
342
+ - implicit
343
+ - each
344
+ - example
267
345
  VersionAdded: '1.7'
268
346
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HookArgument
269
347
 
@@ -284,8 +362,8 @@ RSpec/ImplicitExpect:
284
362
  Enabled: true
285
363
  EnforcedStyle: is_expected
286
364
  SupportedStyles:
287
- - is_expected
288
- - should
365
+ - is_expected
366
+ - should
289
367
  VersionAdded: '1.8'
290
368
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitExpect
291
369
 
@@ -294,9 +372,9 @@ RSpec/ImplicitSubject:
294
372
  Enabled: true
295
373
  EnforcedStyle: single_line_only
296
374
  SupportedStyles:
297
- - single_line_only
298
- - single_statement_only
299
- - disallow
375
+ - single_line_only
376
+ - single_statement_only
377
+ - disallow
300
378
  VersionAdded: '1.29'
301
379
  VersionChanged: '1.30'
302
380
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitSubject
@@ -315,19 +393,13 @@ RSpec/InstanceVariable:
315
393
  VersionChanged: '1.7'
316
394
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable
317
395
 
318
- RSpec/InvalidPredicateMatcher:
319
- Description: Checks invalid usage for predicate matcher.
320
- Enabled: true
321
- VersionAdded: '1.16'
322
- StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InvalidPredicateMatcher
323
-
324
396
  RSpec/ItBehavesLike:
325
397
  Description: Checks that only one `it_behaves_like` style is used.
326
398
  Enabled: true
327
399
  EnforcedStyle: it_behaves_like
328
400
  SupportedStyles:
329
- - it_behaves_like
330
- - it_should_behave_like
401
+ - it_behaves_like
402
+ - it_should_behave_like
331
403
  VersionAdded: '1.13'
332
404
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ItBehavesLike
333
405
 
@@ -374,8 +446,8 @@ RSpec/MessageExpectation:
374
446
  Enabled: false
375
447
  EnforcedStyle: allow
376
448
  SupportedStyles:
377
- - allow
378
- - expect
449
+ - allow
450
+ - expect
379
451
  VersionAdded: '1.7'
380
452
  VersionChanged: '1.8'
381
453
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageExpectation
@@ -385,8 +457,8 @@ RSpec/MessageSpies:
385
457
  Enabled: true
386
458
  EnforcedStyle: have_received
387
459
  SupportedStyles:
388
- - have_received
389
- - receive
460
+ - have_received
461
+ - receive
390
462
  VersionAdded: '1.9'
391
463
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies
392
464
 
@@ -444,8 +516,8 @@ RSpec/NotToNot:
444
516
  Enabled: true
445
517
  EnforcedStyle: not_to
446
518
  SupportedStyles:
447
- - not_to
448
- - to_not
519
+ - not_to
520
+ - to_not
449
521
  VersionAdded: '1.4'
450
522
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
451
523
 
@@ -468,8 +540,8 @@ RSpec/PredicateMatcher:
468
540
  EnforcedStyle: inflected
469
541
  AllowedExplicitMatchers: []
470
542
  SupportedStyles:
471
- - inflected
472
- - explicit
543
+ - inflected
544
+ - explicit
473
545
  SafeAutoCorrect: false
474
546
  VersionAdded: '1.16'
475
547
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PredicateMatcher
@@ -521,8 +593,8 @@ RSpec/ReturnFromStub:
521
593
  Enabled: true
522
594
  EnforcedStyle: and_return
523
595
  SupportedStyles:
524
- - and_return
525
- - block
596
+ - and_return
597
+ - block
526
598
  VersionAdded: '1.16'
527
599
  VersionChanged: '1.22'
528
600
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReturnFromStub
@@ -561,7 +633,7 @@ RSpec/SingleArgumentMessageChain:
561
633
 
562
634
  RSpec/StubbedMock:
563
635
  Description: Checks that message expectations do not have a configured response.
564
- Enabled: pending
636
+ Enabled: true
565
637
  VersionAdded: '1.44'
566
638
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/StubbedMock
567
639
 
@@ -582,8 +654,8 @@ RSpec/VariableDefinition:
582
654
  Enabled: true
583
655
  EnforcedStyle: symbols
584
656
  SupportedStyles:
585
- - symbols
586
- - strings
657
+ - symbols
658
+ - strings
587
659
  VersionAdded: '1.40'
588
660
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableDefinition
589
661
 
@@ -592,8 +664,8 @@ RSpec/VariableName:
592
664
  Enabled: true
593
665
  EnforcedStyle: snake_case
594
666
  SupportedStyles:
595
- - snake_case
596
- - camelCase
667
+ - snake_case
668
+ - camelCase
597
669
  IgnoredPatterns: []
598
670
  VersionAdded: '1.40'
599
671
  VersionChanged: '1.43'
@@ -645,6 +717,10 @@ RSpec/Capybara/VisibilityMatcher:
645
717
  RSpec/FactoryBot/AttributeDefinedStatically:
646
718
  Description: Always declare attribute values as blocks.
647
719
  Enabled: true
720
+ Include:
721
+ - spec/factories.rb
722
+ - spec/factories/**/*.rb
723
+ - features/support/factories/**/*.rb
648
724
  VersionAdded: '1.28'
649
725
  VersionChanged: '2.0'
650
726
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/AttributeDefinedStatically
@@ -652,10 +728,16 @@ RSpec/FactoryBot/AttributeDefinedStatically:
652
728
  RSpec/FactoryBot/CreateList:
653
729
  Description: Checks for create_list usage.
654
730
  Enabled: true
731
+ Include:
732
+ - "**/*_spec.rb"
733
+ - "**/spec/**/*"
734
+ - spec/factories.rb
735
+ - spec/factories/**/*.rb
736
+ - features/support/factories/**/*.rb
655
737
  EnforcedStyle: create_list
656
738
  SupportedStyles:
657
- - create_list
658
- - n_times
739
+ - create_list
740
+ - n_times
659
741
  VersionAdded: '1.25'
660
742
  VersionChanged: '2.0'
661
743
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList
@@ -663,6 +745,10 @@ RSpec/FactoryBot/CreateList:
663
745
  RSpec/FactoryBot/FactoryClassName:
664
746
  Description: Use string value when setting the class attribute explicitly.
665
747
  Enabled: true
748
+ Include:
749
+ - spec/factories.rb
750
+ - spec/factories/**/*.rb
751
+ - features/support/factories/**/*.rb
666
752
  VersionAdded: '1.37'
667
753
  VersionChanged: '2.0'
668
754
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName
@@ -672,8 +758,8 @@ RSpec/Rails/HttpStatus:
672
758
  Enabled: true
673
759
  EnforcedStyle: symbolic
674
760
  SupportedStyles:
675
- - numeric
676
- - symbolic
761
+ - numeric
762
+ - symbolic
677
763
  VersionAdded: '1.23'
678
764
  VersionChanged: '2.0'
679
765
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus