mangrove 0.24.0 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -5
  3. data/lib/mangrove/result.rb +73 -64
  4. data/lib/mangrove/version.rb +1 -1
  5. data/rbi/mangrove.rbi +20 -0
  6. data/sorbet/rbi/annotations/rainbow.rbi +3 -3
  7. data/sorbet/rbi/gems/{diff-lcs@1.5.0.rbi → diff-lcs@1.5.1.rbi} +100 -48
  8. data/sorbet/rbi/gems/{io-console@0.6.0.rbi → io-console@0.7.2.rbi} +1 -0
  9. data/sorbet/rbi/gems/{json@2.6.3.rbi → json@2.7.2.rbi} +95 -74
  10. data/sorbet/rbi/gems/{parallel@1.23.0.rbi → parallel@1.24.0.rbi} +9 -1
  11. data/sorbet/rbi/gems/{parser@3.2.2.4.rbi → parser@3.3.2.0.rbi} +1267 -1282
  12. data/sorbet/rbi/gems/prism@0.29.0.rbi +37987 -0
  13. data/sorbet/rbi/gems/{psych@5.1.1.1.rbi → psych@5.1.2.rbi} +231 -267
  14. data/sorbet/rbi/gems/{racc@1.7.1.rbi → racc@1.8.0.rbi} +37 -36
  15. data/sorbet/rbi/gems/{rake@13.0.6.rbi → rake@13.2.1.rbi} +217 -73
  16. data/sorbet/rbi/gems/{rbi@0.1.3.rbi → rbi@0.1.13.rbi} +322 -166
  17. data/sorbet/rbi/gems/{rdoc@6.6.0.rbi → rdoc@6.7.0.rbi} +735 -685
  18. data/sorbet/rbi/gems/{regexp_parser@2.8.2.rbi → regexp_parser@2.9.2.rbi} +192 -169
  19. data/sorbet/rbi/gems/{reline@0.4.0.rbi → reline@0.5.8.rbi} +1 -0
  20. data/sorbet/rbi/gems/{rexml@3.2.6.rbi → rexml@3.2.8.rbi} +122 -109
  21. data/sorbet/rbi/gems/{rspec-core@3.12.2.rbi → rspec-core@3.13.0.rbi} +400 -300
  22. data/sorbet/rbi/gems/{rspec-expectations@3.12.3.rbi → rspec-expectations@3.13.0.rbi} +173 -119
  23. data/sorbet/rbi/gems/{rspec-mocks@3.12.6.rbi → rspec-mocks@3.13.1.rbi} +195 -160
  24. data/sorbet/rbi/gems/{rspec-support@3.12.1.rbi → rspec-support@3.13.1.rbi} +319 -298
  25. data/sorbet/rbi/gems/{rspec@3.12.0.rbi → rspec@3.13.0.rbi} +23 -22
  26. data/sorbet/rbi/gems/ruboclean@0.6.0.rbi +315 -0
  27. data/sorbet/rbi/gems/{rubocop-ast@1.29.0.rbi → rubocop-ast@1.31.3.rbi} +348 -285
  28. data/sorbet/rbi/gems/{rubocop-capybara@2.19.0.rbi → rubocop-capybara@2.20.0.rbi} +148 -65
  29. data/sorbet/rbi/gems/{rubocop-factory_bot@2.24.0.rbi → rubocop-factory_bot@2.25.1.rbi} +70 -20
  30. data/sorbet/rbi/gems/{rubocop-rspec@2.24.1.rbi → rubocop-rspec@2.30.0.rbi} +678 -389
  31. data/sorbet/rbi/gems/rubocop-rspec_rails@2.28.3.rbi +911 -0
  32. data/sorbet/rbi/gems/{rubocop@1.57.1.rbi → rubocop@1.64.1.rbi} +3225 -1915
  33. data/sorbet/rbi/gems/{ruby-lsp@0.12.0.rbi → ruby-lsp@0.17.2.rbi} +1 -0
  34. data/sorbet/rbi/gems/{spoom@1.2.4.rbi → spoom@1.3.2.rbi} +1057 -413
  35. data/sorbet/rbi/gems/strscan@3.1.0.rbi +9 -0
  36. data/sorbet/rbi/gems/{tapioca@0.11.10.rbi → tapioca@0.14.3.rbi} +268 -234
  37. data/sorbet/rbi/gems/{thor@1.3.0.rbi → thor@1.3.1.rbi} +57 -50
  38. data/sorbet/rbi/gems/{yard@0.9.34.rbi → yard@0.9.36.rbi} +154 -82
  39. metadata +38 -38
  40. data/sorbet/rbi/gems/base64@0.1.1.rbi +0 -172
  41. data/sorbet/rbi/gems/irb@1.9.0.rbi +0 -342
  42. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +0 -951
  43. data/sorbet/rbi/gems/prism@0.15.1.rbi +0 -23922
  44. data/sorbet/rbi/gems/ruboclean@0.4.0.rbi +0 -189
  45. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +0 -23136
  46. /data/sorbet/rbi/gems/{stringio@3.0.9.rbi → stringio@3.1.0.rbi} +0 -0
@@ -4,6 +4,7 @@
4
4
  # This is an autogenerated file for types exported from the `rubocop-rspec` gem.
5
5
  # Please instead update this file by running `bin/tapioca gem rubocop-rspec`.
6
6
 
7
+
7
8
  # source://rubocop-rspec//lib/rubocop/rspec.rb#3
8
9
  module RuboCop; end
9
10
 
@@ -243,7 +244,7 @@ class RuboCop::Cop::RSpec::BeEmpty < ::RuboCop::Cop::RSpec::Base
243
244
  # source://rubocop-rspec//lib/rubocop/cop/rspec/be_empty.rb#23
244
245
  def expect_array_matcher?(param0 = T.unsafe(nil)); end
245
246
 
246
- # source://rubocop-rspec//lib/rubocop/cop/rspec/be_empty.rb#34
247
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/be_empty.rb#35
247
248
  def on_send(node); end
248
249
  end
249
250
 
@@ -387,41 +388,35 @@ RuboCop::Cop::RSpec::BeNil::BE_NIL_MSG = T.let(T.unsafe(nil), String)
387
388
  # source://rubocop-rspec//lib/rubocop/cop/rspec/be_nil.rb#33
388
389
  RuboCop::Cop::RSpec::BeNil::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
389
390
 
390
- # Check that before/after(:all) isn't being used.
391
+ # Check that before/after(:all/:context) isn't being used.
391
392
  #
392
393
  # @example
393
- # # bad
394
- # #
395
- # # Faster but risk of state leaking between examples
396
- # #
394
+ # # bad - Faster but risk of state leaking between examples
397
395
  # describe MyClass do
398
396
  # before(:all) { Widget.create }
399
- # after(:all) { Widget.delete_all }
397
+ # after(:context) { Widget.delete_all }
400
398
  # end
401
399
  #
402
- # # good
403
- # #
404
- # # Slower but examples are properly isolated
405
- # #
400
+ # # good - Slower but examples are properly isolated
406
401
  # describe MyClass do
407
402
  # before(:each) { Widget.create }
408
403
  # after(:each) { Widget.delete_all }
409
404
  # end
410
405
  #
411
- # source://rubocop-rspec//lib/rubocop/cop/rspec/before_after_all.rb#27
406
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/before_after_all.rb#21
412
407
  class RuboCop::Cop::RSpec::BeforeAfterAll < ::RuboCop::Cop::RSpec::Base
413
- # source://rubocop-rspec//lib/rubocop/cop/rspec/before_after_all.rb#36
408
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/before_after_all.rb#30
414
409
  def before_or_after_all(param0 = T.unsafe(nil)); end
415
410
 
416
- # source://rubocop-rspec//lib/rubocop/cop/rspec/before_after_all.rb#40
411
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/before_after_all.rb#34
417
412
  def on_send(node); end
418
413
  end
419
414
 
420
- # source://rubocop-rspec//lib/rubocop/cop/rspec/before_after_all.rb#28
415
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/before_after_all.rb#22
421
416
  RuboCop::Cop::RSpec::BeforeAfterAll::MSG = T.let(T.unsafe(nil), String)
422
417
 
423
- # source://rubocop-rspec//lib/rubocop/cop/rspec/before_after_all.rb#33
424
- RuboCop::Cop::RSpec::BeforeAfterAll::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
418
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/before_after_all.rb#27
419
+ RuboCop::Cop::RSpec::BeforeAfterAll::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
425
420
 
426
421
  # source://rubocop-rspec//lib/rubocop/cop/rspec/capybara/current_path_expectation.rb#6
427
422
  module RuboCop::Cop::RSpec::Capybara; end
@@ -714,59 +709,69 @@ RuboCop::Cop::RSpec::Capybara::VisibilityMatcher = RuboCop::Cop::Capybara::Visib
714
709
  #
715
710
  # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#60
716
711
  class RuboCop::Cop::RSpec::ChangeByZero < ::RuboCop::Cop::RSpec::Base
712
+ include ::RuboCop::Cop::RangeHelp
717
713
  extend ::RuboCop::Cop::AutoCorrector
718
714
 
719
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#86
715
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#88
720
716
  def change_nodes(param0); end
721
717
 
722
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#69
718
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#71
723
719
  def expect_change_with_arguments(param0 = T.unsafe(nil)); end
724
720
 
725
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#76
721
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#78
726
722
  def expect_change_with_block(param0 = T.unsafe(nil)); end
727
723
 
728
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#90
724
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#92
729
725
  def on_send(node); end
730
726
 
731
727
  private
732
728
 
733
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#131
729
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#133
734
730
  def autocorrect(corrector, node, change_node); end
735
731
 
736
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#138
732
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#140
737
733
  def autocorrect_compound(corrector, node); end
738
734
 
739
735
  # @return [Boolean]
740
736
  #
741
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#118
737
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#120
742
738
  def compound_expectations?(node); end
743
739
 
744
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#122
740
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#150
741
+ def insert_operator(corrector, node, change_node); end
742
+
743
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#124
745
744
  def message(change_node); end
746
745
 
747
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#126
746
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#128
748
747
  def message_compound(change_node); end
749
748
 
750
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#148
749
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#174
751
750
  def negated_matcher; end
752
751
 
753
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#152
752
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#178
754
753
  def preferred_method; end
755
754
 
756
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#103
755
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#105
757
756
  def register_offense(node, change_node); end
757
+
758
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#163
759
+ def remove_by_zero(corrector, node, change_node); end
760
+
761
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#159
762
+ def replace_node(node, change_node); end
758
763
  end
759
764
 
760
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#65
765
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#67
761
766
  RuboCop::Cop::RSpec::ChangeByZero::CHANGE_METHODS = T.let(T.unsafe(nil), Set)
762
767
 
763
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#62
768
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#64
764
769
  RuboCop::Cop::RSpec::ChangeByZero::MSG = T.let(T.unsafe(nil), String)
765
770
 
766
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#63
771
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#65
767
772
  RuboCop::Cop::RSpec::ChangeByZero::MSG_COMPOUND = T.let(T.unsafe(nil), String)
768
773
 
769
- # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#66
774
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/change_by_zero.rb#68
770
775
  RuboCop::Cop::RSpec::ChangeByZero::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
771
776
 
772
777
  # Enforces consistent use of `be_a` or `be_kind_of`.
@@ -1159,8 +1164,10 @@ RuboCop::Cop::RSpec::DescribeSymbol::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr
1159
1164
  # If the first argument of describe is a class, the class is exposed to
1160
1165
  # each example via described_class.
1161
1166
  #
1162
- # This cop can be configured using the `EnforcedStyle` and `SkipBlocks`
1163
- # options.
1167
+ # This cop can be configured using the `EnforcedStyle`, `SkipBlocks`
1168
+ # and `OnlyStaticConstants` options.
1169
+ # `OnlyStaticConstants` is only relevant when `EnforcedStyle` is
1170
+ # `described_class`.
1164
1171
  #
1165
1172
  # There's a known caveat with rspec-rails's `controller` helper that
1166
1173
  # runs its block in a different context, and `described_class` is not
@@ -1181,6 +1188,16 @@ RuboCop::Cop::RSpec::DescribeSymbol::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr
1181
1188
  # describe MyClass do
1182
1189
  # subject { described_class.do_something }
1183
1190
  # end
1191
+ # @example `OnlyStaticConstants: true` (default)
1192
+ # # good
1193
+ # describe MyClass do
1194
+ # subject { MyClass::CONSTANT }
1195
+ # end
1196
+ # @example `OnlyStaticConstants: false`
1197
+ # # bad
1198
+ # describe MyClass do
1199
+ # subject { MyClass::CONSTANT }
1200
+ # end
1184
1201
  # @example `EnforcedStyle: explicit`
1185
1202
  # # bad
1186
1203
  # describe MyClass do
@@ -1203,33 +1220,38 @@ RuboCop::Cop::RSpec::DescribeSymbol::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr
1203
1220
  # end
1204
1221
  # end
1205
1222
  #
1206
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#57
1223
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#71
1207
1224
  class RuboCop::Cop::RSpec::DescribedClass < ::RuboCop::Cop::RSpec::Base
1208
1225
  include ::RuboCop::Cop::ConfigurableEnforcedStyle
1209
1226
  include ::RuboCop::Cop::RSpec::Namespace
1210
1227
  extend ::RuboCop::Cop::AutoCorrector
1211
1228
 
1212
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#66
1229
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#80
1213
1230
  def common_instance_exec_closure?(param0 = T.unsafe(nil)); end
1214
1231
 
1215
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#83
1232
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#97
1216
1233
  def contains_described_class?(param0); end
1217
1234
 
1218
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#78
1235
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#92
1219
1236
  def described_constant(param0 = T.unsafe(nil)); end
1220
1237
 
1221
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#86
1238
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#100
1222
1239
  def on_block(node); end
1223
1240
 
1224
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#71
1241
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#85
1225
1242
  def rspec_block?(param0 = T.unsafe(nil)); end
1226
1243
 
1227
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#75
1244
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#89
1228
1245
  def scope_changing_syntax?(param0 = T.unsafe(nil)); end
1229
1246
 
1230
1247
  private
1231
1248
 
1232
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#103
1249
+ # @return [Boolean]
1250
+ #
1251
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#136
1252
+ def allowed?(node); end
1253
+
1254
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#117
1233
1255
  def autocorrect(corrector, match); end
1234
1256
 
1235
1257
  # @example
@@ -1243,7 +1265,7 @@ class RuboCop::Cop::RSpec::DescribedClass < ::RuboCop::Cop::RSpec::Base
1243
1265
  # @param const [Array<Symbol>]
1244
1266
  # @return [Array<Symbol>]
1245
1267
  #
1246
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#179
1268
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#200
1247
1269
  def collapse_namespace(namespace, const); end
1248
1270
 
1249
1271
  # @example
@@ -1253,45 +1275,50 @@ class RuboCop::Cop::RSpec::DescribedClass < ::RuboCop::Cop::RSpec::Base
1253
1275
  # @param node [RuboCop::AST::Node]
1254
1276
  # @return [Array<Symbol>]
1255
1277
  #
1256
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#196
1278
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#217
1257
1279
  def const_name(node); end
1258
1280
 
1259
1281
  # @yield [node]
1260
1282
  #
1261
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#113
1283
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#127
1262
1284
  def find_usage(node, &block); end
1263
1285
 
1264
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#164
1286
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#185
1265
1287
  def full_const_name(node); end
1266
1288
 
1267
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#123
1289
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#140
1268
1290
  def message(offense); end
1269
1291
 
1270
1292
  # @return [Boolean]
1271
1293
  #
1272
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#142
1294
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#163
1273
1295
  def offensive?(node); end
1274
1296
 
1275
1297
  # @return [Boolean]
1276
1298
  #
1277
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#150
1299
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#171
1278
1300
  def offensive_described_class?(node); end
1279
1301
 
1280
1302
  # @return [Boolean]
1281
1303
  #
1282
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#132
1304
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#159
1305
+ def only_static_constants?; end
1306
+
1307
+ # @return [Boolean]
1308
+ #
1309
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#149
1283
1310
  def scope_change?(node); end
1284
1311
 
1285
1312
  # @return [Boolean]
1286
1313
  #
1287
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#138
1314
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#155
1288
1315
  def skippable_block?(node); end
1289
1316
  end
1290
1317
 
1291
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#62
1318
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#76
1292
1319
  RuboCop::Cop::RSpec::DescribedClass::DESCRIBED_CLASS = T.let(T.unsafe(nil), String)
1293
1320
 
1294
- # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#63
1321
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/described_class.rb#77
1295
1322
  RuboCop::Cop::RSpec::DescribedClass::MSG = T.let(T.unsafe(nil), String)
1296
1323
 
1297
1324
  # Avoid opening modules and defining specs within them.
@@ -1865,6 +1892,34 @@ end
1865
1892
  # source://rubocop-rspec//lib/rubocop/cop/rspec/empty_metadata.rb#20
1866
1893
  RuboCop::Cop::RSpec::EmptyMetadata::MSG = T.let(T.unsafe(nil), String)
1867
1894
 
1895
+ # Check that the `output` matcher is not called with an empty string.
1896
+ #
1897
+ # @example
1898
+ # # bad
1899
+ # expect { foo }.to output('').to_stdout
1900
+ # expect { bar }.not_to output('').to_stderr
1901
+ #
1902
+ # # good
1903
+ # expect { foo }.not_to output.to_stdout
1904
+ # expect { bar }.to output.to_stderr
1905
+ #
1906
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/empty_output.rb#17
1907
+ class RuboCop::Cop::RSpec::EmptyOutput < ::RuboCop::Cop::RSpec::Base
1908
+ extend ::RuboCop::Cop::AutoCorrector
1909
+
1910
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/empty_output.rb#24
1911
+ def matching_empty_output(param0 = T.unsafe(nil)); end
1912
+
1913
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/empty_output.rb#34
1914
+ def on_send(send_node); end
1915
+ end
1916
+
1917
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/empty_output.rb#20
1918
+ RuboCop::Cop::RSpec::EmptyOutput::MSG = T.let(T.unsafe(nil), String)
1919
+
1920
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/empty_output.rb#21
1921
+ RuboCop::Cop::RSpec::EmptyOutput::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1922
+
1868
1923
  # Use `eq` instead of `be ==` to compare objects.
1869
1924
  #
1870
1925
  # @example
@@ -1903,9 +1958,10 @@ RuboCop::Cop::RSpec::Eq::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1903
1958
  # extracting out some behavior, e.g. with a `let` block, or a helper
1904
1959
  # method.
1905
1960
  #
1906
- # You can set literals you want to fold with `CountAsOne`.
1907
- # Available are: 'array', 'hash', and 'heredoc'. Each literal
1908
- # will be counted as one line regardless of its actual size.
1961
+ # You can set constructs you want to fold with `CountAsOne`.
1962
+ # Available are: 'array', 'hash', 'heredoc', and 'method_call'.
1963
+ # Each construct will be counted as one line regardless of
1964
+ # its actual size.
1909
1965
  #
1910
1966
  # @example
1911
1967
  # # bad
@@ -1923,7 +1979,7 @@ RuboCop::Cop::RSpec::Eq::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1923
1979
  # result = service.call
1924
1980
  # expect(result).to be(true)
1925
1981
  # end
1926
- # @example CountAsOne: ['array', 'heredoc']
1982
+ # @example CountAsOne: ['array', 'heredoc', 'method_call']
1927
1983
  #
1928
1984
  # it do
1929
1985
  # array = [ # +1
@@ -1939,28 +1995,34 @@ RuboCop::Cop::RSpec::Eq::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1939
1995
  # Heredoc
1940
1996
  # content.
1941
1997
  # HEREDOC
1942
- # end # 5 points
1943
1998
  #
1944
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_length.rb#51
1999
+ # foo( # +1
2000
+ # 1,
2001
+ # 2
2002
+ # )
2003
+ # end # 6 points
2004
+ #
2005
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_length.rb#57
1945
2006
  class RuboCop::Cop::RSpec::ExampleLength < ::RuboCop::Cop::RSpec::Base
1946
2007
  include ::RuboCop::Cop::CodeLength
1947
2008
 
1948
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_length.rb#56
2009
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_length.rb#62
1949
2010
  def on_block(node); end
1950
2011
 
1951
2012
  private
1952
2013
 
1953
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_length.rb#64
2014
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_length.rb#70
1954
2015
  def cop_label; end
1955
2016
  end
1956
2017
 
1957
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_length.rb#54
2018
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_length.rb#60
1958
2019
  RuboCop::Cop::RSpec::ExampleLength::LABEL = T.let(T.unsafe(nil), String)
1959
2020
 
1960
2021
  # Checks for examples without a description.
1961
2022
  #
1962
2023
  # RSpec allows for auto-generated example descriptions when there is no
1963
2024
  # description provided or the description is an empty one.
2025
+ # It is acceptable to use `specify` without a description
1964
2026
  #
1965
2027
  # This cop removes empty descriptions.
1966
2028
  # It also defines whether auto-generated description is allowed, based
@@ -1968,17 +2030,23 @@ RuboCop::Cop::RSpec::ExampleLength::LABEL = T.let(T.unsafe(nil), String)
1968
2030
  #
1969
2031
  # This cop can be configured using the `EnforcedStyle` option
1970
2032
  #
2033
+ # @example
2034
+ # # always good
2035
+ # specify do
2036
+ # result = service.call
2037
+ # expect(result).to be(true)
2038
+ # end
1971
2039
  # @example `EnforcedStyle: always_allow` (default)
1972
2040
  # # bad
1973
2041
  # it('') { is_expected.to be_good }
1974
- # it '' do
2042
+ # specify '' do
1975
2043
  # result = service.call
1976
2044
  # expect(result).to be(true)
1977
2045
  # end
1978
2046
  #
1979
2047
  # # good
1980
2048
  # it { is_expected.to be_good }
1981
- # it do
2049
+ # specify do
1982
2050
  # result = service.call
1983
2051
  # expect(result).to be(true)
1984
2052
  # end
@@ -2000,31 +2068,31 @@ RuboCop::Cop::RSpec::ExampleLength::LABEL = T.let(T.unsafe(nil), String)
2000
2068
  # expect(result).to be(true)
2001
2069
  # end
2002
2070
  #
2003
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#51
2071
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#59
2004
2072
  class RuboCop::Cop::RSpec::ExampleWithoutDescription < ::RuboCop::Cop::RSpec::Base
2005
2073
  include ::RuboCop::Cop::ConfigurableEnforcedStyle
2006
2074
 
2007
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#59
2075
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#67
2008
2076
  def example_description(param0 = T.unsafe(nil)); end
2009
2077
 
2010
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#61
2078
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#69
2011
2079
  def on_block(node); end
2012
2080
 
2013
2081
  private
2014
2082
 
2015
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#75
2083
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#83
2016
2084
  def check_example_without_description(node); end
2017
2085
 
2018
2086
  # @return [Boolean]
2019
2087
  #
2020
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#82
2088
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#91
2021
2089
  def disallow_empty_description?(node); end
2022
2090
  end
2023
2091
 
2024
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#56
2092
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#64
2025
2093
  RuboCop::Cop::RSpec::ExampleWithoutDescription::MSG_ADD_DESCRIPTION = T.let(T.unsafe(nil), String)
2026
2094
 
2027
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#54
2095
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_without_description.rb#62
2028
2096
  RuboCop::Cop::RSpec::ExampleWithoutDescription::MSG_DEFAULT_ARGUMENT = T.let(T.unsafe(nil), String)
2029
2097
 
2030
2098
  # Checks for common mistakes in example descriptions.
@@ -2044,6 +2112,9 @@ RuboCop::Cop::RSpec::ExampleWithoutDescription::MSG_DEFAULT_ARGUMENT = T.let(T.u
2044
2112
  # it 'should find nothing' do
2045
2113
  # end
2046
2114
  #
2115
+ # it 'will find nothing' do
2116
+ # end
2117
+ #
2047
2118
  # # good
2048
2119
  # it 'finds nothing' do
2049
2120
  # end
@@ -2065,66 +2136,72 @@ RuboCop::Cop::RSpec::ExampleWithoutDescription::MSG_DEFAULT_ARGUMENT = T.let(T.u
2065
2136
  # end
2066
2137
  # @see http://betterspecs.org/#should
2067
2138
  #
2068
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#46
2139
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#49
2069
2140
  class RuboCop::Cop::RSpec::ExampleWording < ::RuboCop::Cop::RSpec::Base
2070
2141
  extend ::RuboCop::Cop::AutoCorrector
2071
2142
 
2072
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#58
2143
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#63
2073
2144
  def it_description(param0 = T.unsafe(nil)); end
2074
2145
 
2075
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#65
2146
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#71
2076
2147
  def on_block(node); end
2077
2148
 
2078
2149
  private
2079
2150
 
2080
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#80
2151
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#89
2081
2152
  def add_wording_offense(node, message); end
2082
2153
 
2083
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#127
2154
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#136
2084
2155
  def custom_transform; end
2085
2156
 
2086
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#90
2157
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#99
2087
2158
  def docstring(node); end
2088
2159
 
2089
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#131
2160
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#140
2090
2161
  def ignored_words; end
2091
2162
 
2092
2163
  # @return [Boolean]
2093
2164
  #
2094
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#135
2165
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#144
2095
2166
  def insufficient_docstring?(description_node); end
2096
2167
 
2097
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#139
2168
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#148
2098
2169
  def insufficient_examples; end
2099
2170
 
2100
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#144
2171
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#153
2101
2172
  def preprocess(message); end
2102
2173
 
2103
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#100
2174
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#109
2104
2175
  def replacement_text(node); end
2105
2176
 
2106
2177
  # Recursive processing is required to process nested dstr nodes
2107
2178
  # that is the case for \-separated multiline strings with interpolation.
2108
2179
  #
2109
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#116
2180
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#125
2110
2181
  def text(node); end
2111
2182
  end
2112
2183
 
2113
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#55
2184
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#60
2114
2185
  RuboCop::Cop::RSpec::ExampleWording::IT_PREFIX = T.let(T.unsafe(nil), Regexp)
2115
2186
 
2116
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#51
2187
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#55
2117
2188
  RuboCop::Cop::RSpec::ExampleWording::MSG_INSUFFICIENT_DESCRIPTION = T.let(T.unsafe(nil), String)
2118
2189
 
2119
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#50
2190
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#54
2120
2191
  RuboCop::Cop::RSpec::ExampleWording::MSG_IT = T.let(T.unsafe(nil), String)
2121
2192
 
2122
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#49
2193
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#52
2123
2194
  RuboCop::Cop::RSpec::ExampleWording::MSG_SHOULD = T.let(T.unsafe(nil), String)
2124
2195
 
2125
- # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#54
2196
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#53
2197
+ RuboCop::Cop::RSpec::ExampleWording::MSG_WILL = T.let(T.unsafe(nil), String)
2198
+
2199
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#58
2126
2200
  RuboCop::Cop::RSpec::ExampleWording::SHOULD_PREFIX = T.let(T.unsafe(nil), Regexp)
2127
2201
 
2202
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/example_wording.rb#59
2203
+ RuboCop::Cop::RSpec::ExampleWording::WILL_PREFIX = T.let(T.unsafe(nil), Regexp)
2204
+
2128
2205
  # Checks for excessive whitespace in example descriptions.
2129
2206
  #
2130
2207
  # @example
@@ -2208,17 +2285,17 @@ RuboCop::Cop::RSpec::ExcessiveDocstringSpacing::MSG = T.let(T.unsafe(nil), Strin
2208
2285
  class RuboCop::Cop::RSpec::ExpectActual < ::RuboCop::Cop::RSpec::Base
2209
2286
  extend ::RuboCop::Cop::AutoCorrector
2210
2287
 
2211
- # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#56
2288
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#57
2212
2289
  def expect_literal(param0 = T.unsafe(nil)); end
2213
2290
 
2214
- # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#67
2291
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#68
2215
2292
  def on_send(node); end
2216
2293
 
2217
2294
  private
2218
2295
 
2219
2296
  # @return [Boolean]
2220
2297
  #
2221
- # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#90
2298
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#98
2222
2299
  def complex_literal?(node); end
2223
2300
 
2224
2301
  # This is not implemented using a NodePattern because it seems
@@ -2226,21 +2303,21 @@ class RuboCop::Cop::RSpec::ExpectActual < ::RuboCop::Cop::RSpec::Base
2226
2303
  #
2227
2304
  # @return [Boolean]
2228
2305
  #
2229
- # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#82
2306
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#90
2230
2307
  def literal?(node); end
2231
2308
 
2232
2309
  # @return [Boolean]
2233
2310
  #
2234
- # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#86
2311
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#94
2235
2312
  def simple_literal?(node); end
2236
-
2237
- # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#95
2238
- def swap(corrector, actual, expected); end
2239
2313
  end
2240
2314
 
2241
2315
  # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#44
2242
2316
  RuboCop::Cop::RSpec::ExpectActual::COMPLEX_LITERALS = T.let(T.unsafe(nil), Array)
2243
2317
 
2318
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#54
2319
+ RuboCop::Cop::RSpec::ExpectActual::CORRECTABLE_MATCHERS = T.let(T.unsafe(nil), Array)
2320
+
2244
2321
  # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#27
2245
2322
  RuboCop::Cop::RSpec::ExpectActual::MSG = T.let(T.unsafe(nil), String)
2246
2323
 
@@ -2251,7 +2328,7 @@ RuboCop::Cop::RSpec::ExpectActual::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array
2251
2328
  RuboCop::Cop::RSpec::ExpectActual::SIMPLE_LITERALS = T.let(T.unsafe(nil), Array)
2252
2329
 
2253
2330
  # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_actual.rb#53
2254
- RuboCop::Cop::RSpec::ExpectActual::SUPPORTED_MATCHERS = T.let(T.unsafe(nil), Array)
2331
+ RuboCop::Cop::RSpec::ExpectActual::SKIPPED_MATCHERS = T.let(T.unsafe(nil), Array)
2255
2332
 
2256
2333
  # Checks for consistent style of change matcher.
2257
2334
  #
@@ -2343,6 +2420,39 @@ end
2343
2420
  # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_in_hook.rb#25
2344
2421
  RuboCop::Cop::RSpec::ExpectInHook::MSG = T.let(T.unsafe(nil), String)
2345
2422
 
2423
+ # Do not use `expect` in let.
2424
+ #
2425
+ # @example
2426
+ # # bad
2427
+ # let(:foo) do
2428
+ # expect(something).to eq 'foo'
2429
+ # end
2430
+ #
2431
+ # # good
2432
+ # it do
2433
+ # expect(something).to eq 'foo'
2434
+ # end
2435
+ #
2436
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_in_let.rb#19
2437
+ class RuboCop::Cop::RSpec::ExpectInLet < ::RuboCop::Cop::RSpec::Base
2438
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_in_let.rb#23
2439
+ def expectation(param0); end
2440
+
2441
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_in_let.rb#25
2442
+ def on_block(node); end
2443
+
2444
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_in_let.rb#25
2445
+ def on_numblock(node); end
2446
+
2447
+ private
2448
+
2449
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_in_let.rb#38
2450
+ def message(expect); end
2451
+ end
2452
+
2453
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_in_let.rb#20
2454
+ RuboCop::Cop::RSpec::ExpectInLet::MSG = T.let(T.unsafe(nil), String)
2455
+
2346
2456
  # Checks for opportunities to use `expect { ... }.to output`.
2347
2457
  #
2348
2458
  # @example
@@ -2372,7 +2482,7 @@ class RuboCop::Cop::RSpec::ExpectOutput < ::RuboCop::Cop::RSpec::Base
2372
2482
  #
2373
2483
  # @return [Boolean]
2374
2484
  #
2375
- # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_output.rb#43
2485
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/expect_output.rb#40
2376
2486
  def inside_example_scope?(node); end
2377
2487
  end
2378
2488
 
@@ -3432,7 +3542,7 @@ RuboCop::Cop::RSpec::InstanceSpy::MSG = T.let(T.unsafe(nil), String)
3432
3542
  # @example with AssignmentOnly configuration
3433
3543
  # # rubocop.yml
3434
3544
  # # RSpec/InstanceVariable:
3435
- # # AssignmentOnly: false
3545
+ # # AssignmentOnly: true
3436
3546
  #
3437
3547
  # # bad
3438
3548
  # describe MyClass do
@@ -3486,6 +3596,41 @@ end
3486
3596
  # source://rubocop-rspec//lib/rubocop/cop/rspec/instance_variable.rb#51
3487
3597
  RuboCop::Cop::RSpec::InstanceVariable::MSG = T.let(T.unsafe(nil), String)
3488
3598
 
3599
+ # Check for `specify` with `is_expected` and one-liner expectations.
3600
+ #
3601
+ # @example
3602
+ # # bad
3603
+ # specify { is_expected.to be_truthy }
3604
+ #
3605
+ # # good
3606
+ # it { is_expected.to be_truthy }
3607
+ #
3608
+ # # good
3609
+ # specify do
3610
+ # # ...
3611
+ # end
3612
+ # specify { expect(sqrt(4)).to eq(2) }
3613
+ #
3614
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/is_expected_specify.rb#21
3615
+ class RuboCop::Cop::RSpec::IsExpectedSpecify < ::RuboCop::Cop::RSpec::Base
3616
+ extend ::RuboCop::Cop::AutoCorrector
3617
+
3618
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/is_expected_specify.rb#29
3619
+ def offense?(param0 = T.unsafe(nil)); end
3620
+
3621
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/is_expected_specify.rb#33
3622
+ def on_send(node); end
3623
+ end
3624
+
3625
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/is_expected_specify.rb#25
3626
+ RuboCop::Cop::RSpec::IsExpectedSpecify::IS_EXPECTED_METHODS = T.let(T.unsafe(nil), Set)
3627
+
3628
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/is_expected_specify.rb#26
3629
+ RuboCop::Cop::RSpec::IsExpectedSpecify::MSG = T.let(T.unsafe(nil), String)
3630
+
3631
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/is_expected_specify.rb#24
3632
+ RuboCop::Cop::RSpec::IsExpectedSpecify::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
3633
+
3489
3634
  # Checks that only one `it_behaves_like` style is used.
3490
3635
  #
3491
3636
  # @example `EnforcedStyle: it_behaves_like` (default)
@@ -3996,31 +4141,28 @@ RuboCop::Cop::RSpec::MessageChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array
3996
4141
  class RuboCop::Cop::RSpec::MessageExpectation < ::RuboCop::Cop::RSpec::Base
3997
4142
  include ::RuboCop::Cop::ConfigurableEnforcedStyle
3998
4143
 
3999
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_expectation.rb#36
4144
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/message_expectation.rb#35
4000
4145
  def message_expectation(param0 = T.unsafe(nil)); end
4001
4146
 
4002
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_expectation.rb#43
4147
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/message_expectation.rb#42
4003
4148
  def on_send(node); end
4004
4149
 
4005
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_expectation.rb#41
4150
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/message_expectation.rb#40
4006
4151
  def receive_message?(param0); end
4007
4152
 
4008
4153
  private
4009
4154
 
4010
4155
  # @return [Boolean]
4011
4156
  #
4012
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_expectation.rb#56
4157
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/message_expectation.rb#55
4013
4158
  def preferred_style?(expectation); end
4014
4159
  end
4015
4160
 
4016
4161
  # source://rubocop-rspec//lib/rubocop/cop/rspec/message_expectation.rb#30
4017
4162
  RuboCop::Cop::RSpec::MessageExpectation::MSG = T.let(T.unsafe(nil), String)
4018
4163
 
4019
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_expectation.rb#33
4020
- RuboCop::Cop::RSpec::MessageExpectation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
4021
-
4022
4164
  # source://rubocop-rspec//lib/rubocop/cop/rspec/message_expectation.rb#32
4023
- RuboCop::Cop::RSpec::MessageExpectation::SUPPORTED_STYLES = T.let(T.unsafe(nil), Array)
4165
+ RuboCop::Cop::RSpec::MessageExpectation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
4024
4166
 
4025
4167
  # Checks that message expectations are set using spies.
4026
4168
  #
@@ -4052,26 +4194,26 @@ RuboCop::Cop::RSpec::MessageExpectation::SUPPORTED_STYLES = T.let(T.unsafe(nil),
4052
4194
  class RuboCop::Cop::RSpec::MessageSpies < ::RuboCop::Cop::RSpec::Base
4053
4195
  include ::RuboCop::Cop::ConfigurableEnforcedStyle
4054
4196
 
4055
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#47
4197
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#45
4056
4198
  def message_expectation(param0 = T.unsafe(nil)); end
4057
4199
 
4058
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#56
4200
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#54
4059
4201
  def on_send(node); end
4060
4202
 
4061
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#52
4203
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#50
4062
4204
  def receive_message(param0); end
4063
4205
 
4064
4206
  private
4065
4207
 
4066
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#79
4208
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#77
4067
4209
  def error_message(receiver); end
4068
4210
 
4069
4211
  # @return [Boolean]
4070
4212
  #
4071
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#75
4213
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#73
4072
4214
  def preferred_style?(expectation); end
4073
4215
 
4074
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#69
4216
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#67
4075
4217
  def receive_message_matcher(node); end
4076
4218
  end
4077
4219
 
@@ -4081,11 +4223,8 @@ RuboCop::Cop::RSpec::MessageSpies::MSG_HAVE_RECEIVED = T.let(T.unsafe(nil), Stri
4081
4223
  # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#36
4082
4224
  RuboCop::Cop::RSpec::MessageSpies::MSG_RECEIVE = T.let(T.unsafe(nil), String)
4083
4225
 
4084
- # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#44
4085
- RuboCop::Cop::RSpec::MessageSpies::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
4086
-
4087
4226
  # source://rubocop-rspec//lib/rubocop/cop/rspec/message_spies.rb#42
4088
- RuboCop::Cop::RSpec::MessageSpies::SUPPORTED_STYLES = T.let(T.unsafe(nil), Array)
4227
+ RuboCop::Cop::RSpec::MessageSpies::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
4089
4228
 
4090
4229
  # Helper methods to find RSpec metadata.
4091
4230
  #
@@ -4117,7 +4256,7 @@ module RuboCop::Cop::RSpec::Metadata
4117
4256
  private
4118
4257
 
4119
4258
  # source://rubocop-rspec//lib/rubocop/cop/rspec/mixin/metadata.rb#49
4120
- def on_matadata_arguments(metadata_arguments); end
4259
+ def on_metadata_arguments(metadata_arguments); end
4121
4260
  end
4122
4261
 
4123
4262
  # Use consistent metadata style.
@@ -4160,59 +4299,59 @@ class RuboCop::Cop::RSpec::MetadataStyle < ::RuboCop::Cop::RSpec::Base
4160
4299
 
4161
4300
  private
4162
4301
 
4163
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#61
4302
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#66
4164
4303
  def autocorrect_pair(corrector, node); end
4165
4304
 
4166
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#66
4305
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#71
4167
4306
  def autocorrect_symbol(corrector, node); end
4168
4307
 
4169
4308
  # @return [Boolean]
4170
4309
  #
4171
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#73
4310
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#78
4172
4311
  def bad_metadata_pair?(node); end
4173
4312
 
4174
4313
  # @return [Boolean]
4175
4314
  #
4176
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#77
4315
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#82
4177
4316
  def bad_metadata_symbol?(_node); end
4178
4317
 
4179
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#81
4318
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#86
4180
4319
  def format_symbol_to_pair_source(node); end
4181
4320
 
4182
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#85
4321
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#90
4183
4322
  def insert_pair(corrector, node); end
4184
4323
 
4185
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#96
4324
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#101
4186
4325
  def insert_pair_as_last_argument(corrector, node); end
4187
4326
 
4188
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#105
4327
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#110
4189
4328
  def insert_pair_to_empty_hash_metadata(corrector, node, hash_node); end
4190
4329
 
4191
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#112
4330
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#117
4192
4331
  def insert_pair_to_non_empty_hash_metadata(corrector, node, hash_node); end
4193
4332
 
4194
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#119
4333
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#124
4195
4334
  def insert_symbol(corrector, node); end
4196
4335
 
4197
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#126
4336
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#131
4198
4337
  def message_for_style; end
4199
4338
 
4200
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#133
4339
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#138
4201
4340
  def on_metadata_pair(node); end
4202
4341
 
4203
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#141
4342
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#146
4204
4343
  def on_metadata_symbol(node); end
4205
4344
 
4206
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#149
4345
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#154
4207
4346
  def remove_pair(corrector, node); end
4208
4347
 
4209
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#159
4348
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#164
4210
4349
  def remove_pair_following(corrector, node); end
4211
4350
 
4212
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#171
4351
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#176
4213
4352
  def remove_pair_preceding(corrector, node); end
4214
4353
 
4215
- # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#183
4354
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/metadata_style.rb#188
4216
4355
  def remove_symbol(corrector, node); end
4217
4356
  end
4218
4357
 
@@ -4313,12 +4452,16 @@ RuboCop::Cop::RSpec::MultipleDescribes::MSG = T.let(T.unsafe(nil), String)
4313
4452
  # expect(user.age).to eq(22)
4314
4453
  # end
4315
4454
  # end
4316
- # @example configuration
4317
- # # .rubocop.yml
4318
- # # RSpec/MultipleExpectations:
4319
- # # Max: 2
4320
- #
4321
- # # not flagged by rubocop
4455
+ # @example `Max: 1` (default)
4456
+ # # bad
4457
+ # describe UserCreator do
4458
+ # it 'builds a user' do
4459
+ # expect(user.name).to eq("John")
4460
+ # expect(user.age).to eq(22)
4461
+ # end
4462
+ # end
4463
+ # @example `Max: 2`
4464
+ # # good
4322
4465
  # describe UserCreator do
4323
4466
  # it 'builds a user' do
4324
4467
  # expect(user.name).to eq("John")
@@ -4327,49 +4470,49 @@ RuboCop::Cop::RSpec::MultipleDescribes::MSG = T.let(T.unsafe(nil), String)
4327
4470
  # end
4328
4471
  # @see http://betterspecs.org/#single Single expectation test
4329
4472
  #
4330
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#64
4473
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#69
4331
4474
  class RuboCop::Cop::RSpec::MultipleExpectations < ::RuboCop::Cop::RSpec::Base
4332
4475
  include ::RuboCop::Cop::ConfigurableMax
4333
4476
 
4334
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#73
4477
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#78
4335
4478
  def aggregate_failures?(param0 = T.unsafe(nil), param1); end
4336
4479
 
4337
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#84
4480
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#89
4338
4481
  def aggregate_failures_block?(param0 = T.unsafe(nil)); end
4339
4482
 
4340
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#81
4483
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#86
4341
4484
  def expect?(param0 = T.unsafe(nil)); end
4342
4485
 
4343
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#88
4486
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#93
4344
4487
  def on_block(node); end
4345
4488
 
4346
4489
  private
4347
4490
 
4348
4491
  # @return [Boolean]
4349
4492
  #
4350
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#104
4493
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#109
4351
4494
  def example_with_aggregate_failures?(example_node); end
4352
4495
 
4353
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#111
4496
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#116
4354
4497
  def find_aggregate_failures(example_node); end
4355
4498
 
4356
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#116
4499
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#121
4357
4500
  def find_expectation(node, &block); end
4358
4501
 
4359
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#127
4502
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#132
4360
4503
  def flag_example(node, expectation_count:); end
4361
4504
 
4362
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#138
4505
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#143
4363
4506
  def max_expectations; end
4364
4507
  end
4365
4508
 
4366
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#69
4509
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#74
4367
4510
  RuboCop::Cop::RSpec::MultipleExpectations::ANYTHING = T.let(T.unsafe(nil), Proc)
4368
4511
 
4369
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#67
4512
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#72
4370
4513
  RuboCop::Cop::RSpec::MultipleExpectations::MSG = T.let(T.unsafe(nil), String)
4371
4514
 
4372
- # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#70
4515
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#75
4373
4516
  RuboCop::Cop::RSpec::MultipleExpectations::TRUE = T.let(T.unsafe(nil), Proc)
4374
4517
 
4375
4518
  # Checks if example groups contain too many `let` and `subject` calls.
@@ -5237,7 +5380,8 @@ RuboCop::Cop::RSpec::PredicateMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), A
5237
5380
  # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb#6
5238
5381
  module RuboCop::Cop::RSpec::Rails; end
5239
5382
 
5240
- # Checks that tests use RSpec `before` hook over Rails `setup` method.
5383
+ # Checks that tests use RSpec `before` hook over Rails `setup`
5384
+ # method.
5241
5385
  #
5242
5386
  # @example
5243
5387
  # # bad
@@ -5250,55 +5394,88 @@ module RuboCop::Cop::RSpec::Rails; end
5250
5394
  # allow(foo).to receive(:bar)
5251
5395
  # end
5252
5396
  #
5253
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb#20
5254
- class RuboCop::Cop::RSpec::Rails::AvoidSetupHook < ::RuboCop::Cop::RSpec::Base
5255
- extend ::RuboCop::Cop::AutoCorrector
5256
-
5257
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb#32
5258
- def on_block(node); end
5259
-
5260
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb#26
5261
- def setup_call(param0 = T.unsafe(nil)); end
5262
- end
5263
-
5264
5397
  # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb#23
5265
- RuboCop::Cop::RSpec::Rails::AvoidSetupHook::MSG = T.let(T.unsafe(nil), String)
5398
+ RuboCop::Cop::RSpec::Rails::AvoidSetupHook = RuboCop::Cop::RSpecRails::AvoidSetupHook
5266
5399
 
5267
5400
  # Checks that tests use `have_http_status` instead of equality matchers.
5268
5401
  #
5269
- # @example
5402
+ # @example ResponseMethods: ['response', 'last_response'] (default)
5270
5403
  # # bad
5271
5404
  # expect(response.status).to be(200)
5272
- # expect(response.code).to eq("200")
5405
+ # expect(last_response.code).to eq("200")
5273
5406
  #
5274
5407
  # # good
5275
5408
  # expect(response).to have_http_status(200)
5409
+ # expect(last_response).to have_http_status(200)
5410
+ # @example ResponseMethods: ['foo_response']
5411
+ # # bad
5412
+ # expect(foo_response.status).to be(200)
5276
5413
  #
5277
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/have_http_status.rb#17
5278
- class RuboCop::Cop::RSpec::Rails::HaveHttpStatus < ::RuboCop::Cop::Base
5279
- extend ::RuboCop::Cop::AutoCorrector
5280
-
5281
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/have_http_status.rb#28
5282
- def match_status(param0 = T.unsafe(nil)); end
5283
-
5284
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/have_http_status.rb#38
5285
- def on_send(node); end
5286
- end
5287
-
5288
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/have_http_status.rb#20
5289
- RuboCop::Cop::RSpec::Rails::HaveHttpStatus::MSG = T.let(T.unsafe(nil), String)
5290
-
5291
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/have_http_status.rb#25
5292
- RuboCop::Cop::RSpec::Rails::HaveHttpStatus::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
5414
+ # # good
5415
+ # expect(foo_response).to have_http_status(200)
5416
+ #
5417
+ # # also good
5418
+ # expect(response).to have_http_status(200)
5419
+ # expect(last_response).to have_http_status(200)
5420
+ #
5421
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/have_http_status.rb#31
5422
+ RuboCop::Cop::RSpec::Rails::HaveHttpStatus = RuboCop::Cop::RSpecRails::HaveHttpStatus
5293
5423
 
5294
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/have_http_status.rb#24
5295
- RuboCop::Cop::RSpec::Rails::HaveHttpStatus::RUNNERS = T.let(T.unsafe(nil), Set)
5424
+ # Enforces use of symbolic or numeric value to describe HTTP status.
5425
+ #
5426
+ # This cop inspects only `have_http_status` calls.
5427
+ # So, this cop does not check if a method starting with `be_*` is
5428
+ # used when setting for `EnforcedStyle: symbolic` or
5429
+ # `EnforcedStyle: numeric`.
5430
+ #
5431
+ # @example `EnforcedStyle: symbolic` (default)
5432
+ # # bad
5433
+ # it { is_expected.to have_http_status 200 }
5434
+ # it { is_expected.to have_http_status 404 }
5435
+ # it { is_expected.to have_http_status "403" }
5436
+ #
5437
+ # # good
5438
+ # it { is_expected.to have_http_status :ok }
5439
+ # it { is_expected.to have_http_status :not_found }
5440
+ # it { is_expected.to have_http_status :forbidden }
5441
+ # it { is_expected.to have_http_status :success }
5442
+ # it { is_expected.to have_http_status :error }
5443
+ # @example `EnforcedStyle: numeric`
5444
+ # # bad
5445
+ # it { is_expected.to have_http_status :ok }
5446
+ # it { is_expected.to have_http_status :not_found }
5447
+ # it { is_expected.to have_http_status "forbidden" }
5448
+ #
5449
+ # # good
5450
+ # it { is_expected.to have_http_status 200 }
5451
+ # it { is_expected.to have_http_status 404 }
5452
+ # it { is_expected.to have_http_status 403 }
5453
+ # it { is_expected.to have_http_status :success }
5454
+ # it { is_expected.to have_http_status :error }
5455
+ # @example `EnforcedStyle: be_status`
5456
+ # # bad
5457
+ # it { is_expected.to have_http_status :ok }
5458
+ # it { is_expected.to have_http_status :not_found }
5459
+ # it { is_expected.to have_http_status "forbidden" }
5460
+ # it { is_expected.to have_http_status 200 }
5461
+ # it { is_expected.to have_http_status 404 }
5462
+ # it { is_expected.to have_http_status "403" }
5463
+ #
5464
+ # # good
5465
+ # it { is_expected.to be_ok }
5466
+ # it { is_expected.to be_not_found }
5467
+ # it { is_expected.to have_http_status :success }
5468
+ # it { is_expected.to have_http_status :error }
5469
+ #
5470
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/http_status.rb#57
5471
+ RuboCop::Cop::RSpec::Rails::HttpStatus = RuboCop::Cop::RSpecRails::HttpStatus
5296
5472
 
5297
5473
  # Identifies redundant spec type.
5298
5474
  #
5299
5475
  # After setting up rspec-rails, you will have enabled
5300
5476
  # `config.infer_spec_type_from_file_location!` by default in
5301
- # spec/rails_helper.rb. This cop works in conjunction with this config.
5477
+ # spec/rails_helper.rb. This cop works in conjunction with
5478
+ # this config.
5302
5479
  # If you disable this config, disable this cop as well.
5303
5480
  #
5304
5481
  # @example
@@ -5337,108 +5514,37 @@ RuboCop::Cop::RSpec::Rails::HaveHttpStatus::RUNNERS = T.let(T.unsafe(nil), Set)
5337
5514
  # RSpec.describe User, type: :common do
5338
5515
  # end
5339
5516
  #
5340
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#54
5341
- class RuboCop::Cop::RSpec::Rails::InferredSpecType < ::RuboCop::Cop::RSpec::Base
5342
- extend ::RuboCop::Cop::AutoCorrector
5343
-
5344
- # @param node [RuboCop::AST::BlockNode]
5345
- # @return [RuboCop::AST::PairNode, nil]
5346
- #
5347
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#79
5348
- def describe_with_type(param0 = T.unsafe(nil)); end
5349
-
5350
- # @param node [RuboCop::AST::BlockNode]
5351
- #
5352
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#60
5353
- def on_block(node); end
5354
-
5355
- # @param node [RuboCop::AST::BlockNode]
5356
- #
5357
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#60
5358
- def on_numblock(node); end
5359
-
5360
- private
5361
-
5362
- # @param corrector [RuboCop::AST::Corrector]
5363
- # @param node [RuboCop::AST::Node]
5364
- #
5365
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#91
5366
- def autocorrect(corrector, node); end
5367
-
5368
- # @param node [RuboCop::AST::PairNode]
5369
- # @return [RuboCop::AST::Node]
5370
- #
5371
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#111
5372
- def detect_removable_node(node); end
5373
-
5374
- # @return [String]
5375
- #
5376
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#120
5377
- def file_path; end
5517
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#58
5518
+ RuboCop::Cop::RSpec::Rails::InferredSpecType = RuboCop::Cop::RSpecRails::InferredSpecType
5378
5519
 
5379
- # @return [Hash]
5380
- #
5381
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#138
5382
- def inferences; end
5383
-
5384
- # @param node [RuboCop::AST::PairNode]
5385
- # @return [Boolean]
5386
- #
5387
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#126
5388
- def inferred_type?(node); end
5389
-
5390
- # @return [Symbol, nil]
5391
- #
5392
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#131
5393
- def inferred_type_from_file_path; end
5394
-
5395
- # @param node [RuboCop::AST::Node]
5396
- # @return [Parser::Source::Range]
5397
- #
5398
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#97
5399
- def remove_range(node); end
5400
- end
5401
-
5402
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/inferred_spec_type.rb#57
5403
- RuboCop::Cop::RSpec::Rails::InferredSpecType::MSG = T.let(T.unsafe(nil), String)
5404
-
5405
- # Check if using Minitest matchers.
5520
+ # Check if using Minitest-like matchers.
5521
+ #
5522
+ # Check the use of minitest-like matchers
5523
+ # starting with `assert_` or `refute_`.
5406
5524
  #
5407
5525
  # @example
5408
5526
  # # bad
5409
5527
  # assert_equal(a, b)
5410
5528
  # assert_equal a, b, "must be equal"
5529
+ # assert_not_includes a, b
5411
5530
  # refute_equal(a, b)
5531
+ # assert_nil a
5532
+ # refute_empty(b)
5533
+ # assert_true(a)
5534
+ # assert_false(a)
5412
5535
  #
5413
5536
  # # good
5414
5537
  # expect(b).to eq(a)
5415
5538
  # expect(b).to(eq(a), "must be equal")
5539
+ # expect(a).not_to include(b)
5416
5540
  # expect(b).not_to eq(a)
5541
+ # expect(a).to eq(nil)
5542
+ # expect(a).not_to be_empty
5543
+ # expect(a).to be(true)
5544
+ # expect(a).to be(false)
5417
5545
  #
5418
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/minitest_assertions.rb#20
5419
- class RuboCop::Cop::RSpec::Rails::MinitestAssertions < ::RuboCop::Cop::RSpec::Base
5420
- extend ::RuboCop::Cop::AutoCorrector
5421
-
5422
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/minitest_assertions.rb#27
5423
- def minitest_assertion(param0 = T.unsafe(nil)); end
5424
-
5425
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/minitest_assertions.rb#31
5426
- def on_send(node); end
5427
-
5428
- private
5429
-
5430
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/minitest_assertions.rb#53
5431
- def message(prefer); end
5432
-
5433
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/minitest_assertions.rb#43
5434
- def replacement(node, expected, actual, failure_message); end
5435
- end
5436
-
5437
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/minitest_assertions.rb#23
5438
- RuboCop::Cop::RSpec::Rails::MinitestAssertions::MSG = T.let(T.unsafe(nil), String)
5439
-
5440
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/minitest_assertions.rb#24
5441
- RuboCop::Cop::RSpec::Rails::MinitestAssertions::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
5546
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/minitest_assertions.rb#35
5547
+ RuboCop::Cop::RSpec::Rails::MinitestAssertions = RuboCop::Cop::RSpecRails::MinitestAssertions
5442
5548
 
5443
5549
  # Enforces use of `be_invalid` or `not_to` for negated be_valid.
5444
5550
  #
@@ -5461,45 +5567,8 @@ RuboCop::Cop::RSpec::Rails::MinitestAssertions::RESTRICT_ON_SEND = T.let(T.unsaf
5461
5567
  # # good (with method chain)
5462
5568
  # expect(foo).to be_invalid.or be_even
5463
5569
  #
5464
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#33
5465
- class RuboCop::Cop::RSpec::Rails::NegationBeValid < ::RuboCop::Cop::RSpec::Base
5466
- include ::RuboCop::Cop::ConfigurableEnforcedStyle
5467
- extend ::RuboCop::Cop::AutoCorrector
5468
-
5469
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#46
5470
- def be_invalid?(param0 = T.unsafe(nil)); end
5471
-
5472
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#41
5473
- def not_to?(param0 = T.unsafe(nil)); end
5474
-
5475
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#50
5476
- def on_send(node); end
5477
-
5478
- private
5479
-
5480
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#75
5481
- def message(_matcher); end
5482
-
5483
- # @return [Boolean]
5484
- #
5485
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#62
5486
- def offense?(node); end
5487
-
5488
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#71
5489
- def offense_range(node); end
5490
-
5491
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#90
5492
- def replaced_matcher; end
5493
-
5494
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#81
5495
- def replaced_runner; end
5496
- end
5497
-
5498
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#37
5499
- RuboCop::Cop::RSpec::Rails::NegationBeValid::MSG = T.let(T.unsafe(nil), String)
5500
-
5501
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#38
5502
- RuboCop::Cop::RSpec::Rails::NegationBeValid::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
5570
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/negation_be_valid.rb#35
5571
+ RuboCop::Cop::RSpec::Rails::NegationBeValid = RuboCop::Cop::RSpecRails::NegationBeValid
5503
5572
 
5504
5573
  # Prefer to travel in `before` rather than `around`.
5505
5574
  #
@@ -5514,39 +5583,8 @@ RuboCop::Cop::RSpec::Rails::NegationBeValid::RESTRICT_ON_SEND = T.let(T.unsafe(n
5514
5583
  # # good
5515
5584
  # before { freeze_time }
5516
5585
  #
5517
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/travel_around.rb#27
5518
- class RuboCop::Cop::RSpec::Rails::TravelAround < ::RuboCop::Cop::RSpec::Base
5519
- extend ::RuboCop::Cop::AutoCorrector
5520
-
5521
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/travel_around.rb#39
5522
- def extract_run_in_travel(param0 = T.unsafe(nil)); end
5523
-
5524
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/travel_around.rb#48
5525
- def match_around_each?(param0 = T.unsafe(nil)); end
5526
-
5527
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/travel_around.rb#55
5528
- def on_block(node); end
5529
-
5530
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/travel_around.rb#55
5531
- def on_numblock(node); end
5532
-
5533
- private
5534
-
5535
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/travel_around.rb#70
5536
- def autocorrect(corrector, node, run_node, around_node); end
5537
-
5538
- # @param node [RuboCop::AST::BlockNode]
5539
- # @return [RuboCop::AST::BlockNode, nil]
5540
- #
5541
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/travel_around.rb#83
5542
- def extract_surrounding_around_block(node); end
5543
- end
5544
-
5545
5586
  # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/travel_around.rb#30
5546
- RuboCop::Cop::RSpec::Rails::TravelAround::MSG = T.let(T.unsafe(nil), String)
5547
-
5548
- # source://rubocop-rspec//lib/rubocop/cop/rspec/rails/travel_around.rb#32
5549
- RuboCop::Cop::RSpec::Rails::TravelAround::TRAVEL_METHOD_NAMES = T.let(T.unsafe(nil), Set)
5587
+ RuboCop::Cop::RSpec::Rails::TravelAround = RuboCop::Cop::RSpecRails::TravelAround
5550
5588
 
5551
5589
  # Check for `once` and `twice` receive counts matchers usage.
5552
5590
  #
@@ -5762,6 +5800,75 @@ RuboCop::Cop::RSpec::RedundantAround::MSG = T.let(T.unsafe(nil), String)
5762
5800
  # source://rubocop-rspec//lib/rubocop/cop/rspec/redundant_around.rb#21
5763
5801
  RuboCop::Cop::RSpec::RedundantAround::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
5764
5802
 
5803
+ # Checks for redundant predicate matcher.
5804
+ #
5805
+ # @example
5806
+ # # bad
5807
+ # expect(foo).to be_exist(bar)
5808
+ # expect(foo).not_to be_include(bar)
5809
+ # expect(foo).to be_all(bar)
5810
+ #
5811
+ # # good
5812
+ # expect(foo).to exist(bar)
5813
+ # expect(foo).not_to include(bar)
5814
+ # expect(foo).to all be(bar)
5815
+ #
5816
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/redundant_predicate_matcher.rb#19
5817
+ class RuboCop::Cop::RSpec::RedundantPredicateMatcher < ::RuboCop::Cop::RSpec::Base
5818
+ extend ::RuboCop::Cop::AutoCorrector
5819
+
5820
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/redundant_predicate_matcher.rb#28
5821
+ def on_send(node); end
5822
+
5823
+ private
5824
+
5825
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/redundant_predicate_matcher.rb#44
5826
+ def message(bad_method, good_method); end
5827
+
5828
+ # @return [Boolean]
5829
+ #
5830
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/redundant_predicate_matcher.rb#48
5831
+ def replaceable_arguments?(node); end
5832
+
5833
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/redundant_predicate_matcher.rb#56
5834
+ def replaced_method_name(method_name); end
5835
+ end
5836
+
5837
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/redundant_predicate_matcher.rb#22
5838
+ RuboCop::Cop::RSpec::RedundantPredicateMatcher::MSG = T.let(T.unsafe(nil), String)
5839
+
5840
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/redundant_predicate_matcher.rb#23
5841
+ RuboCop::Cop::RSpec::RedundantPredicateMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
5842
+
5843
+ # Checks that `remove_const` is not used in specs.
5844
+ #
5845
+ # @example
5846
+ # # bad
5847
+ # it 'does something' do
5848
+ # Object.send(:remove_const, :SomeConstant)
5849
+ # end
5850
+ #
5851
+ # before do
5852
+ # SomeClass.send(:remove_const, :SomeConstant)
5853
+ # end
5854
+ #
5855
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/remove_const.rb#18
5856
+ class RuboCop::Cop::RSpec::RemoveConst < ::RuboCop::Cop::RSpec::Base
5857
+ # Check for offenses
5858
+ #
5859
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/remove_const.rb#32
5860
+ def on_send(node); end
5861
+
5862
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/remove_const.rb#27
5863
+ def remove_const(param0 = T.unsafe(nil)); end
5864
+ end
5865
+
5866
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/remove_const.rb#22
5867
+ RuboCop::Cop::RSpec::RemoveConst::MSG = T.let(T.unsafe(nil), String)
5868
+
5869
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/remove_const.rb#24
5870
+ RuboCop::Cop::RSpec::RemoveConst::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
5871
+
5765
5872
  # Check for repeated description strings in example groups.
5766
5873
  #
5767
5874
  # @example
@@ -6077,6 +6184,79 @@ end
6077
6184
  # source://rubocop-rspec//lib/rubocop/cop/rspec/repeated_include_example.rb#49
6078
6185
  RuboCop::Cop::RSpec::RepeatedIncludeExample::MSG = T.let(T.unsafe(nil), String)
6079
6186
 
6187
+ # Checks for repeated calls to subject missing that it is memoized.
6188
+ #
6189
+ # @example
6190
+ # # bad
6191
+ # it do
6192
+ # subject
6193
+ # expect { subject }.to not_change { A.count }
6194
+ # end
6195
+ #
6196
+ # it do
6197
+ # expect { subject }.to change { A.count }
6198
+ # expect { subject }.to not_change { A.count }
6199
+ # end
6200
+ #
6201
+ # # good
6202
+ # it do
6203
+ # expect { my_method }.to change { A.count }
6204
+ # expect { my_method }.to not_change { A.count }
6205
+ # end
6206
+ #
6207
+ # # also good
6208
+ # it do
6209
+ # expect { subject.a }.to change { A.count }
6210
+ # expect { subject.b }.to not_change { A.count }
6211
+ # end
6212
+ #
6213
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/repeated_subject_call.rb#32
6214
+ class RuboCop::Cop::RSpec::RepeatedSubjectCall < ::RuboCop::Cop::RSpec::Base
6215
+ include ::RuboCop::Cop::RSpec::TopLevelGroup
6216
+
6217
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/repeated_subject_call.rb#65
6218
+ def on_top_level_group(node); end
6219
+
6220
+ # Find a named or unnamed subject definition
6221
+ #
6222
+ # @example anonymous subject
6223
+ # subject?(parse('subject { foo }').ast) do |name|
6224
+ # name # => :subject
6225
+ # end
6226
+ # @example named subject
6227
+ # subject?(parse('subject(:thing) { foo }').ast) do |name|
6228
+ # name # => :thing
6229
+ # end
6230
+ # @param node [RuboCop::AST::Node]
6231
+ # @yield [Symbol] subject name
6232
+ #
6233
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/repeated_subject_call.rb#53
6234
+ def subject?(param0 = T.unsafe(nil)); end
6235
+
6236
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/repeated_subject_call.rb#61
6237
+ def subject_calls(param0, param1); end
6238
+
6239
+ private
6240
+
6241
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/repeated_subject_call.rb#73
6242
+ def detect_offense(subject_node); end
6243
+
6244
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/repeated_subject_call.rb#85
6245
+ def detect_offenses_in_block(node, subject_names = T.unsafe(nil)); end
6246
+
6247
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/repeated_subject_call.rb#97
6248
+ def detect_offenses_in_example(node, subject_names); end
6249
+
6250
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/repeated_subject_call.rb#111
6251
+ def detect_subjects_in_scope(node); end
6252
+
6253
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/repeated_subject_call.rb#81
6254
+ def expect_block(node); end
6255
+ end
6256
+
6257
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/repeated_subject_call.rb#35
6258
+ RuboCop::Cop::RSpec::RepeatedSubjectCall::MSG = T.let(T.unsafe(nil), String)
6259
+
6080
6260
  # Checks for consistent style of stub's return setting.
6081
6261
  #
6082
6262
  # Enforces either `and_return` or block-style return in the cases
@@ -6393,9 +6573,13 @@ RuboCop::Cop::RSpec::SharedContext::MSG_CONTEXT = T.let(T.unsafe(nil), String)
6393
6573
  # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_context.rb#56
6394
6574
  RuboCop::Cop::RSpec::SharedContext::MSG_EXAMPLES = T.let(T.unsafe(nil), String)
6395
6575
 
6396
- # Enforces use of string to titleize shared examples.
6576
+ # Checks for consistent style for shared example names.
6397
6577
  #
6398
- # @example
6578
+ # Enforces either `string` or `symbol` for shared example names.
6579
+ #
6580
+ # This cop can be configured using the `EnforcedStyle` option
6581
+ #
6582
+ # @example `EnforcedStyle: string` (default)
6399
6583
  # # bad
6400
6584
  # it_behaves_like :foo_bar_baz
6401
6585
  # it_should_behave_like :foo_bar_baz
@@ -6409,47 +6593,86 @@ RuboCop::Cop::RSpec::SharedContext::MSG_EXAMPLES = T.let(T.unsafe(nil), String)
6409
6593
  # shared_examples 'foo bar baz'
6410
6594
  # shared_examples_for 'foo bar baz'
6411
6595
  # include_examples 'foo bar baz'
6596
+ # @example `EnforcedStyle: symbol`
6597
+ # # bad
6598
+ # it_behaves_like 'foo bar baz'
6599
+ # it_should_behave_like 'foo bar baz'
6600
+ # shared_examples 'foo bar baz'
6601
+ # shared_examples_for 'foo bar baz'
6602
+ # include_examples 'foo bar baz'
6603
+ #
6604
+ # # good
6605
+ # it_behaves_like :foo_bar_baz
6606
+ # it_should_behave_like :foo_bar_baz
6607
+ # shared_examples :foo_bar_baz
6608
+ # shared_examples_for :foo_bar_baz
6609
+ # include_examples :foo_bar_baz
6412
6610
  #
6413
- # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#23
6611
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#42
6414
6612
  class RuboCop::Cop::RSpec::SharedExamples < ::RuboCop::Cop::RSpec::Base
6613
+ include ::RuboCop::Cop::ConfigurableEnforcedStyle
6415
6614
  extend ::RuboCop::Cop::AutoCorrector
6416
6615
 
6417
- # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#34
6616
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#54
6418
6617
  def on_send(node); end
6419
6618
 
6420
- # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#27
6619
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#47
6421
6620
  def shared_examples(param0 = T.unsafe(nil)); end
6621
+
6622
+ private
6623
+
6624
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#75
6625
+ def new_checker(ast_node); end
6626
+
6627
+ # @return [Boolean]
6628
+ #
6629
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#67
6630
+ def offense?(ast_node); end
6422
6631
  end
6423
6632
 
6424
- # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#47
6425
- class RuboCop::Cop::RSpec::SharedExamples::Checker
6426
- # @return [Checker] a new instance of Checker
6633
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#104
6634
+ class RuboCop::Cop::RSpec::SharedExamples::StringChecker
6635
+ # @return [StringChecker] a new instance of StringChecker
6427
6636
  #
6428
- # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#53
6637
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#110
6429
6638
  def initialize(node); end
6430
6639
 
6431
- # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#57
6640
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#114
6432
6641
  def message; end
6433
6642
 
6434
6643
  # Returns the value of attribute node.
6435
6644
  #
6436
- # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#51
6645
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#108
6437
6646
  def node; end
6438
6647
 
6439
- # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#61
6648
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#118
6440
6649
  def preferred_style; end
6650
+ end
6441
6651
 
6442
- private
6652
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#105
6653
+ RuboCop::Cop::RSpec::SharedExamples::StringChecker::MSG = T.let(T.unsafe(nil), String)
6443
6654
 
6444
- # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#68
6445
- def symbol; end
6655
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#84
6656
+ class RuboCop::Cop::RSpec::SharedExamples::SymbolChecker
6657
+ # @return [SymbolChecker] a new instance of SymbolChecker
6658
+ #
6659
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#90
6660
+ def initialize(node); end
6446
6661
 
6447
- # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#72
6448
- def wrap_with_single_quotes(string); end
6662
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#94
6663
+ def message; end
6664
+
6665
+ # Returns the value of attribute node.
6666
+ #
6667
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#88
6668
+ def node; end
6669
+
6670
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#98
6671
+ def preferred_style; end
6449
6672
  end
6450
6673
 
6451
- # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#48
6452
- RuboCop::Cop::RSpec::SharedExamples::Checker::MSG = T.let(T.unsafe(nil), String)
6674
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/shared_examples.rb#85
6675
+ RuboCop::Cop::RSpec::SharedExamples::SymbolChecker::MSG = T.let(T.unsafe(nil), String)
6453
6676
 
6454
6677
  # Checks that chains of messages contain more than one element.
6455
6678
  #
@@ -6491,7 +6714,7 @@ class RuboCop::Cop::RSpec::SingleArgumentMessageChain < ::RuboCop::Cop::RSpec::B
6491
6714
  # source://rubocop-rspec//lib/rubocop/cop/rspec/single_argument_message_chain.rb#83
6492
6715
  def key_to_arg(node); end
6493
6716
 
6494
- # source://rubocop-rspec//lib/rubocop/cop/rspec/single_argument_message_chain.rb#88
6717
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/single_argument_message_chain.rb#87
6495
6718
  def replacement(method); end
6496
6719
 
6497
6720
  # @return [Boolean]
@@ -6673,7 +6896,7 @@ class RuboCop::Cop::RSpec::SpecFilePathFormat < ::RuboCop::Cop::RSpec::Base
6673
6896
  def custom_transform; end
6674
6897
 
6675
6898
  # source://rubocop-rspec//lib/rubocop/cop/rspec/spec_file_path_format.rb#62
6676
- def ensure_correct_file_path(class_name, arguments); end
6899
+ def ensure_correct_file_path(send_node, class_name, arguments); end
6677
6900
 
6678
6901
  # source://rubocop-rspec//lib/rubocop/cop/rspec/spec_file_path_format.rb#98
6679
6902
  def expected_path(constant); end
@@ -7022,6 +7245,66 @@ module RuboCop::Cop::RSpec::TopLevelGroup
7022
7245
  def top_level_nodes(node); end
7023
7246
  end
7024
7247
 
7248
+ # Description should be descriptive.
7249
+ #
7250
+ # If example group or example contains only `execute string`, numbers
7251
+ # and regular expressions, the description is not clear.
7252
+ #
7253
+ # @example
7254
+ # # bad
7255
+ # describe `time` do
7256
+ # # ...
7257
+ # end
7258
+ #
7259
+ # # bad
7260
+ # context /when foo/ do
7261
+ # # ...
7262
+ # end
7263
+ #
7264
+ # # bad
7265
+ # it 10000 do
7266
+ # # ...
7267
+ # end
7268
+ #
7269
+ # # good
7270
+ # describe Foo do
7271
+ # # ...
7272
+ # end
7273
+ #
7274
+ # # good
7275
+ # describe '#foo' do
7276
+ # # ...
7277
+ # end
7278
+ #
7279
+ # # good
7280
+ # context "when #{foo} is bar" do
7281
+ # # ...
7282
+ # end
7283
+ #
7284
+ # # good
7285
+ # it 'does something' do
7286
+ # # ...
7287
+ # end
7288
+ #
7289
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/undescriptive_literals_description.rb#47
7290
+ class RuboCop::Cop::RSpec::UndescriptiveLiteralsDescription < ::RuboCop::Cop::RSpec::Base
7291
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/undescriptive_literals_description.rb#51
7292
+ def example_groups_or_example?(param0 = T.unsafe(nil)); end
7293
+
7294
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/undescriptive_literals_description.rb#55
7295
+ def on_block(node); end
7296
+
7297
+ private
7298
+
7299
+ # @return [Boolean]
7300
+ #
7301
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/undescriptive_literals_description.rb#63
7302
+ def offense?(node); end
7303
+ end
7304
+
7305
+ # source://rubocop-rspec//lib/rubocop/cop/rspec/undescriptive_literals_description.rb#48
7306
+ RuboCop::Cop::RSpec::UndescriptiveLiteralsDescription::MSG = T.let(T.unsafe(nil), String)
7307
+
7025
7308
  # Checks for a specified error in checking raised errors.
7026
7309
  #
7027
7310
  # Enforces one of an Exception type, a string, or a regular
@@ -7400,14 +7683,14 @@ class RuboCop::Cop::Style::TrailingCommaInArguments < ::RuboCop::Cop::Base
7400
7683
  include ::RuboCop::Cop::ConfigurableEnforcedStyle
7401
7684
  include ::RuboCop::Cop::RangeHelp
7402
7685
 
7403
- # source://rubocop/1.57.1/lib/rubocop/cop/style/trailing_comma_in_arguments.rb#95
7686
+ # source://rubocop/1.64.1/lib/rubocop/cop/style/trailing_comma_in_arguments.rb#95
7404
7687
  def on_csend(node); end
7405
7688
 
7406
- # source://rubocop/1.57.1/lib/rubocop/cop/style/trailing_comma_in_arguments.rb#95
7689
+ # source://rubocop/1.64.1/lib/rubocop/cop/style/trailing_comma_in_arguments.rb#95
7407
7690
  def on_send(node); end
7408
7691
 
7409
7692
  class << self
7410
- # source://rubocop-rspec//lib/rubocop-rspec.rb#60
7693
+ # source://rubocop-rspec//lib/rubocop-rspec.rb#63
7411
7694
  def autocorrect_incompatible_with; end
7412
7695
  end
7413
7696
  end
@@ -7555,7 +7838,7 @@ end
7555
7838
 
7556
7839
  # Wrapper for RSpec examples
7557
7840
  #
7558
- # source://rubocop-rspec//lib/rubocop/rspec/example.rb#7
7841
+ # source://rubocop-rspec//lib/rubocop/rspec/example.rb#6
7559
7842
  class RuboCop::RSpec::Example < ::RuboCop::RSpec::Concept
7560
7843
  # source://rubocop-rspec//lib/rubocop/rspec/example.rb#28
7561
7844
  def definition; end
@@ -7581,7 +7864,7 @@ end
7581
7864
 
7582
7865
  # Wrapper for RSpec example groups
7583
7866
  #
7584
- # source://rubocop-rspec//lib/rubocop/rspec/example_group.rb#12
7867
+ # source://rubocop-rspec//lib/rubocop/rspec/example_group.rb#6
7585
7868
  class RuboCop::RSpec::ExampleGroup < ::RuboCop::RSpec::Concept
7586
7869
  # source://rubocop-rspec//lib/rubocop/rspec/example_group.rb#28
7587
7870
  def examples; end
@@ -7621,7 +7904,7 @@ end
7621
7904
 
7622
7905
  # Wrapper for RSpec hook
7623
7906
  #
7624
- # source://rubocop-rspec//lib/rubocop/rspec/hook.rb#7
7907
+ # source://rubocop-rspec//lib/rubocop/rspec/hook.rb#6
7625
7908
  class RuboCop::RSpec::Hook < ::RuboCop::RSpec::Concept
7626
7909
  # @return [Boolean]
7627
7910
  #
@@ -7932,56 +8215,56 @@ RuboCop::RSpec::Version::STRING = T.let(T.unsafe(nil), String)
7932
8215
  class RuboCop::RSpec::Wording
7933
8216
  # @return [Wording] a new instance of Wording
7934
8217
  #
7935
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#12
8218
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#14
7936
8219
  def initialize(text, ignore:, replace:); end
7937
8220
 
7938
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#18
8221
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#21
7939
8222
  def rewrite; end
7940
8223
 
7941
8224
  private
7942
8225
 
7943
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#72
8226
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#80
7944
8227
  def append_suffix(word, suffix); end
7945
8228
 
7946
8229
  # @return [Boolean]
7947
8230
  #
7948
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#57
8231
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#65
7949
8232
  def ignored_word?(word); end
7950
8233
 
7951
8234
  # Returns the value of attribute ignores.
7952
8235
  #
7953
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#31
8236
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#39
7954
8237
  def ignores; end
7955
8238
 
7956
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#43
8239
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#51
7957
8240
  def remove_should_and_pluralize; end
7958
8241
 
7959
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#33
8242
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#41
7960
8243
  def replace_prefix(pattern, replacement); end
7961
8244
 
7962
8245
  # Returns the value of attribute replacements.
7963
8246
  #
7964
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#31
8247
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#39
7965
8248
  def replacements; end
7966
8249
 
7967
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#61
8250
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#69
7968
8251
  def substitute(word); end
7969
8252
 
7970
8253
  # Returns the value of attribute text.
7971
8254
  #
7972
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#31
8255
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#39
7973
8256
  def text; end
7974
8257
 
7975
8258
  # @return [Boolean]
7976
8259
  #
7977
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#39
8260
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#47
7978
8261
  def uppercase?(word); end
7979
8262
  end
7980
8263
 
7981
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#9
8264
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#11
7982
8265
  RuboCop::RSpec::Wording::ES_SUFFIX_PATTERN = T.let(T.unsafe(nil), Regexp)
7983
8266
 
7984
- # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#10
8267
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#12
7985
8268
  RuboCop::RSpec::Wording::IES_SUFFIX_PATTERN = T.let(T.unsafe(nil), Regexp)
7986
8269
 
7987
8270
  # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#8
@@ -7989,3 +8272,9 @@ RuboCop::RSpec::Wording::SHOULDNT_BE_PREFIX = T.let(T.unsafe(nil), Regexp)
7989
8272
 
7990
8273
  # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#7
7991
8274
  RuboCop::RSpec::Wording::SHOULDNT_PREFIX = T.let(T.unsafe(nil), Regexp)
8275
+
8276
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#9
8277
+ RuboCop::RSpec::Wording::WILL_NOT_PREFIX = T.let(T.unsafe(nil), Regexp)
8278
+
8279
+ # source://rubocop-rspec//lib/rubocop/rspec/wording.rb#10
8280
+ RuboCop::RSpec::Wording::WONT_PREFIX = T.let(T.unsafe(nil), Regexp)