legal_entity 0.1.0.pre.beta0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +18 -0
  3. data/CHANGELOG.md +5 -0
  4. data/MIT-LICENSE +21 -0
  5. data/README.md +1 -0
  6. data/Rakefile +10 -0
  7. data/legal_entity.gemspec +45 -0
  8. data/lib/legal_entity/person.rb +7 -0
  9. data/lib/legal_entity/version.rb +6 -0
  10. data/lib/legal_entity.rb +9 -0
  11. data/sorbet/config +4 -0
  12. data/sorbet/rbi/annotations/.gitattributes +1 -0
  13. data/sorbet/rbi/annotations/activemodel.rbi +89 -0
  14. data/sorbet/rbi/annotations/activerecord.rbi +92 -0
  15. data/sorbet/rbi/annotations/activesupport.rbi +421 -0
  16. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  17. data/sorbet/rbi/gems/.gitattributes +1 -0
  18. data/sorbet/rbi/gems/activemodel@7.0.5.rbi +6022 -0
  19. data/sorbet/rbi/gems/activerecord@7.0.5.rbi +37827 -0
  20. data/sorbet/rbi/gems/activesupport@7.0.5.rbi +18125 -0
  21. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  22. data/sorbet/rbi/gems/concurrent-ruby@1.2.3.rbi +11590 -0
  23. data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
  24. data/sorbet/rbi/gems/i18n@1.14.1.rbi +2325 -0
  25. data/sorbet/rbi/gems/json@2.7.1.rbi +1561 -0
  26. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  27. data/sorbet/rbi/gems/minitest@5.22.2.rbi +1535 -0
  28. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  29. data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
  30. data/sorbet/rbi/gems/parser@3.3.0.5.rbi +5472 -0
  31. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  32. data/sorbet/rbi/gems/prism@0.24.0.rbi +31040 -0
  33. data/sorbet/rbi/gems/racc@1.7.3.rbi +161 -0
  34. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  35. data/sorbet/rbi/gems/rake@13.1.0.rbi +3132 -0
  36. data/sorbet/rbi/gems/rbi@0.1.9.rbi +3006 -0
  37. data/sorbet/rbi/gems/regexp_parser@2.9.0.rbi +3771 -0
  38. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
  39. data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7141 -0
  40. data/sorbet/rbi/gems/rubocop-minitest@0.34.5.rbi +2576 -0
  41. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +328 -0
  42. data/sorbet/rbi/gems/rubocop-sorbet@0.7.4.rbi +1442 -0
  43. data/sorbet/rbi/gems/rubocop@1.60.2.rbi +57372 -0
  44. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  45. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  46. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23136 -0
  47. data/sorbet/rbi/gems/tapioca@0.12.0.rbi +3508 -0
  48. data/sorbet/rbi/gems/thor@1.3.0.rbi +4345 -0
  49. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
  50. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  51. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  52. data/sorbet/rbi/gems/yard@0.9.34.rbi +18219 -0
  53. data/sorbet/tapioca/config.yml +13 -0
  54. data/sorbet/tapioca/require.rb +4 -0
  55. metadata +256 -0
@@ -0,0 +1,2576 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `rubocop-minitest` gem.
5
+ # Please instead update this file by running `bin/tapioca gem rubocop-minitest`.
6
+
7
+ # source://rubocop-minitest//lib/rubocop/minitest.rb#3
8
+ module RuboCop; end
9
+
10
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/argument_range_helper.rb#4
11
+ module RuboCop::Cop; end
12
+
13
+ # Methods that calculate and return `Parser::Source::Ranges`.
14
+ #
15
+ # @api private
16
+ #
17
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/argument_range_helper.rb#7
18
+ module RuboCop::Cop::ArgumentRangeHelper
19
+ include ::RuboCop::Cop::RangeHelp
20
+
21
+ private
22
+
23
+ # @api private
24
+ #
25
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/argument_range_helper.rb#19
26
+ def all_arguments_range(node); end
27
+
28
+ # @api private
29
+ #
30
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/argument_range_helper.rb#12
31
+ def first_and_second_arguments_range(node); end
32
+ end
33
+
34
+ # Common functionality for `AssertInDelta` and `RefuteInDelta` cops.
35
+ #
36
+ # @api private
37
+ #
38
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/in_delta_mixin.rb#7
39
+ module RuboCop::Cop::InDeltaMixin
40
+ # @api private
41
+ #
42
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/in_delta_mixin.rb#10
43
+ def on_send(node); end
44
+
45
+ private
46
+
47
+ # @api private
48
+ #
49
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/in_delta_mixin.rb#35
50
+ def assertion_method; end
51
+
52
+ # @api private
53
+ #
54
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/in_delta_mixin.rb#27
55
+ def build_good_method(expected, actual, message); end
56
+ end
57
+
58
+ # @api private
59
+ #
60
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/in_delta_mixin.rb#8
61
+ RuboCop::Cop::InDeltaMixin::MSG = T.let(T.unsafe(nil), String)
62
+
63
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#5
64
+ module RuboCop::Cop::Minitest; end
65
+
66
+ # Enforces the test to use `assert_empty` instead of using `assert(object.empty?)`.
67
+ #
68
+ # @example
69
+ # # bad
70
+ # assert(object.empty?)
71
+ # assert(object.empty?, 'message')
72
+ #
73
+ # # good
74
+ # assert_empty(object)
75
+ # assert_empty(object, 'message')
76
+ #
77
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty.rb#17
78
+ class RuboCop::Cop::Minitest::AssertEmpty < ::RuboCop::Cop::Base
79
+ include ::RuboCop::Cop::RangeHelp
80
+ include ::RuboCop::Cop::ArgumentRangeHelper
81
+ extend ::RuboCop::Cop::MinitestCopRule
82
+ extend ::RuboCop::Cop::AutoCorrector
83
+
84
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
85
+ def autocorrect(corrector, node, arguments); end
86
+
87
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty.rb#23
88
+ def on_send(node); end
89
+
90
+ private
91
+
92
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
93
+ def correct_receiver(receiver); end
94
+
95
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
96
+ def new_arguments(arguments); end
97
+
98
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
99
+ def offense_message(arguments); end
100
+ end
101
+
102
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
103
+ RuboCop::Cop::Minitest::AssertEmpty::MSG = T.let(T.unsafe(nil), String)
104
+
105
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
106
+ RuboCop::Cop::Minitest::AssertEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
107
+
108
+ # Enforces the test to use `assert_empty`
109
+ # instead of using `assert_equal([], object)` or `assert_equal({}, object)`.
110
+ #
111
+ # @example
112
+ # # bad
113
+ # assert_equal([], object)
114
+ # assert_equal({}, object)
115
+ #
116
+ # # good
117
+ # assert_empty(object)
118
+ #
119
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty_literal.rb#17
120
+ class RuboCop::Cop::Minitest::AssertEmptyLiteral < ::RuboCop::Cop::Base
121
+ include ::RuboCop::Cop::RangeHelp
122
+ include ::RuboCop::Cop::ArgumentRangeHelper
123
+ extend ::RuboCop::Cop::AutoCorrector
124
+
125
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty_literal.rb#24
126
+ def assert_equal_with_empty_literal(param0 = T.unsafe(nil)); end
127
+
128
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty_literal.rb#28
129
+ def on_send(node); end
130
+ end
131
+
132
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty_literal.rb#21
133
+ RuboCop::Cop::Minitest::AssertEmptyLiteral::MSG = T.let(T.unsafe(nil), String)
134
+
135
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_empty_literal.rb#22
136
+ RuboCop::Cop::Minitest::AssertEmptyLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
137
+
138
+ # Enforces the use of `assert_equal(expected, actual)`
139
+ # over `assert(expected == actual)`.
140
+ #
141
+ # @example
142
+ # # bad
143
+ # assert("rubocop-minitest" == actual)
144
+ # assert_operator("rubocop-minitest", :==, actual)
145
+ #
146
+ # # good
147
+ # assert_equal("rubocop-minitest", actual)
148
+ #
149
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_equal.rb#17
150
+ class RuboCop::Cop::Minitest::AssertEqual < ::RuboCop::Cop::Base
151
+ include ::RuboCop::Cop::RangeHelp
152
+ include ::RuboCop::Cop::ArgumentRangeHelper
153
+ extend ::RuboCop::Cop::AutoCorrector
154
+
155
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_equal.rb#24
156
+ def assert_equal(param0 = T.unsafe(nil)); end
157
+
158
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_equal.rb#32
159
+ def on_send(node); end
160
+ end
161
+
162
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_equal.rb#21
163
+ RuboCop::Cop::Minitest::AssertEqual::MSG = T.let(T.unsafe(nil), String)
164
+
165
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_equal.rb#22
166
+ RuboCop::Cop::Minitest::AssertEqual::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
167
+
168
+ # Enforces the test to use `assert_in_delta`
169
+ # instead of using `assert_equal` to compare floats.
170
+ #
171
+ # @example
172
+ # # bad
173
+ # assert_equal(0.2, actual)
174
+ # assert_equal(0.2, actual, 'message')
175
+ #
176
+ # # good
177
+ # assert_in_delta(0.2, actual)
178
+ # assert_in_delta(0.2, actual, 0.001, 'message')
179
+ #
180
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_in_delta.rb#18
181
+ class RuboCop::Cop::Minitest::AssertInDelta < ::RuboCop::Cop::Base
182
+ include ::RuboCop::Cop::InDeltaMixin
183
+ extend ::RuboCop::Cop::AutoCorrector
184
+
185
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_in_delta.rb#24
186
+ def equal_floats_call(param0 = T.unsafe(nil)); end
187
+ end
188
+
189
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_in_delta.rb#22
190
+ RuboCop::Cop::Minitest::AssertInDelta::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
191
+
192
+ # Enforces the test to use `assert_includes`
193
+ # instead of using `assert(collection.include?(object))`.
194
+ #
195
+ # @example
196
+ # # bad
197
+ # assert(collection.include?(object))
198
+ # assert(collection.include?(object), 'message')
199
+ #
200
+ # # good
201
+ # assert_includes(collection, object)
202
+ # assert_includes(collection, object, 'message')
203
+ #
204
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_includes.rb#18
205
+ class RuboCop::Cop::Minitest::AssertIncludes < ::RuboCop::Cop::Base
206
+ include ::RuboCop::Cop::RangeHelp
207
+ include ::RuboCop::Cop::ArgumentRangeHelper
208
+ extend ::RuboCop::Cop::MinitestCopRule
209
+ extend ::RuboCop::Cop::AutoCorrector
210
+
211
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
212
+ def autocorrect(corrector, node, arguments); end
213
+
214
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
215
+ def on_send(node); end
216
+
217
+ private
218
+
219
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
220
+ def correct_receiver(receiver); end
221
+
222
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
223
+ def new_arguments(arguments); end
224
+
225
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
226
+ def offense_message(arguments); end
227
+ end
228
+
229
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
230
+ RuboCop::Cop::Minitest::AssertIncludes::MSG = T.let(T.unsafe(nil), String)
231
+
232
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
233
+ RuboCop::Cop::Minitest::AssertIncludes::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
234
+
235
+ # Enforces the test to use `assert_instance_of(Class, object)`
236
+ # over `assert(object.instance_of?(Class))`.
237
+ #
238
+ # @example
239
+ # # bad
240
+ # assert(object.instance_of?(Class))
241
+ # assert(object.instance_of?(Class), 'message')
242
+ #
243
+ # # bad
244
+ # assert_equal(Class, object.class)
245
+ # assert_equal(Class, object.class, 'message')
246
+ #
247
+ # # good
248
+ # assert_instance_of(Class, object)
249
+ # assert_instance_of(Class, object, 'message')
250
+ #
251
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_instance_of.rb#22
252
+ class RuboCop::Cop::Minitest::AssertInstanceOf < ::RuboCop::Cop::Base
253
+ include ::RuboCop::Cop::RangeHelp
254
+ include ::RuboCop::Cop::ArgumentRangeHelper
255
+ include ::RuboCop::Cop::Minitest::InstanceOfAssertionHandleable
256
+ extend ::RuboCop::Cop::AutoCorrector
257
+
258
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_instance_of.rb#28
259
+ def instance_of_assertion?(param0 = T.unsafe(nil)); end
260
+
261
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_instance_of.rb#35
262
+ def on_send(node); end
263
+ end
264
+
265
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_instance_of.rb#26
266
+ RuboCop::Cop::Minitest::AssertInstanceOf::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
267
+
268
+ # Enforces the test to use `assert_kind_of(Class, object)`
269
+ # over `assert(object.kind_of?(Class))`.
270
+ #
271
+ # @example
272
+ # # bad
273
+ # assert(object.kind_of?(Class))
274
+ # assert(object.kind_of?(Class), 'message')
275
+ #
276
+ # # bad
277
+ # # `is_a?` is an alias for `kind_of?`
278
+ # assert(object.is_a?(Class))
279
+ # assert(object.is_a?(Class), 'message')
280
+ #
281
+ # # good
282
+ # assert_kind_of(Class, object)
283
+ # assert_kind_of(Class, object, 'message')
284
+ #
285
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_kind_of.rb#23
286
+ class RuboCop::Cop::Minitest::AssertKindOf < ::RuboCop::Cop::Base
287
+ include ::RuboCop::Cop::RangeHelp
288
+ include ::RuboCop::Cop::ArgumentRangeHelper
289
+ extend ::RuboCop::Cop::MinitestCopRule
290
+ extend ::RuboCop::Cop::AutoCorrector
291
+
292
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
293
+ def autocorrect(corrector, node, arguments); end
294
+
295
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
296
+ def on_send(node); end
297
+
298
+ private
299
+
300
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
301
+ def correct_receiver(receiver); end
302
+
303
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
304
+ def new_arguments(arguments); end
305
+
306
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
307
+ def offense_message(arguments); end
308
+ end
309
+
310
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
311
+ RuboCop::Cop::Minitest::AssertKindOf::MSG = T.let(T.unsafe(nil), String)
312
+
313
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
314
+ RuboCop::Cop::Minitest::AssertKindOf::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
315
+
316
+ # Enforces the test to use `assert_match`
317
+ # instead of using `assert(matcher.match(string))`.
318
+ #
319
+ # @example
320
+ # # bad
321
+ # assert(matcher.match(string))
322
+ # assert(matcher.match?(string))
323
+ # assert(matcher =~ string)
324
+ # assert_operator(matcher, :=~, string)
325
+ # assert(matcher.match(string), 'message')
326
+ #
327
+ # # good
328
+ # assert_match(regex, string)
329
+ # assert_match(matcher, string, 'message')
330
+ #
331
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#21
332
+ class RuboCop::Cop::Minitest::AssertMatch < ::RuboCop::Cop::Base
333
+ include ::RuboCop::Cop::RangeHelp
334
+ include ::RuboCop::Cop::ArgumentRangeHelper
335
+ extend ::RuboCop::Cop::AutoCorrector
336
+
337
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#28
338
+ def assert_match(param0 = T.unsafe(nil)); end
339
+
340
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#36
341
+ def on_send(node); end
342
+
343
+ private
344
+
345
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#59
346
+ def order_expected_and_actual(expected, actual); end
347
+ end
348
+
349
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#25
350
+ RuboCop::Cop::Minitest::AssertMatch::MSG = T.let(T.unsafe(nil), String)
351
+
352
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_match.rb#26
353
+ RuboCop::Cop::Minitest::AssertMatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
354
+
355
+ # Enforces the test to use `assert_nil` instead of using
356
+ # `assert_equal(nil, something)`, `assert(something.nil?)`, or `assert_predicate(something, :nil?)`.
357
+ #
358
+ # @example
359
+ # # bad
360
+ # assert_equal(nil, actual)
361
+ # assert_equal(nil, actual, 'message')
362
+ # assert(object.nil?)
363
+ # assert(object.nil?, 'message')
364
+ # assert_predicate(object, :nil?)
365
+ # assert_predicate(object, :nil?, 'message')
366
+ #
367
+ # # good
368
+ # assert_nil(actual)
369
+ # assert_nil(actual, 'message')
370
+ #
371
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#22
372
+ class RuboCop::Cop::Minitest::AssertNil < ::RuboCop::Cop::Base
373
+ include ::RuboCop::Cop::RangeHelp
374
+ include ::RuboCop::Cop::ArgumentRangeHelper
375
+ include ::RuboCop::Cop::Minitest::NilAssertionHandleable
376
+ extend ::RuboCop::Cop::AutoCorrector
377
+
378
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#30
379
+ def nil_assertion(param0 = T.unsafe(nil)); end
380
+
381
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#38
382
+ def on_send(node); end
383
+
384
+ private
385
+
386
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#46
387
+ def assertion_type; end
388
+ end
389
+
390
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#27
391
+ RuboCop::Cop::Minitest::AssertNil::ASSERTION_TYPE = T.let(T.unsafe(nil), String)
392
+
393
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_nil.rb#28
394
+ RuboCop::Cop::Minitest::AssertNil::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
395
+
396
+ # Enforces the use of `assert_operator(expected, :<, actual)` over `assert(expected < actual)`.
397
+ #
398
+ # @example
399
+ #
400
+ # # bad
401
+ # assert(expected < actual)
402
+ #
403
+ # # good
404
+ # assert_operator(expected, :<, actual)
405
+ #
406
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#16
407
+ class RuboCop::Cop::Minitest::AssertOperator < ::RuboCop::Cop::Base
408
+ extend ::RuboCop::Cop::AutoCorrector
409
+
410
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#23
411
+ def on_send(node); end
412
+
413
+ private
414
+
415
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#41
416
+ def build_new_arguments(node); end
417
+
418
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#52
419
+ def range_of_arguments(node); end
420
+ end
421
+
422
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#21
423
+ RuboCop::Cop::Minitest::AssertOperator::ALLOWED_OPERATORS = T.let(T.unsafe(nil), Array)
424
+
425
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#19
426
+ RuboCop::Cop::Minitest::AssertOperator::MSG = T.let(T.unsafe(nil), String)
427
+
428
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_operator.rb#20
429
+ RuboCop::Cop::Minitest::AssertOperator::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
430
+
431
+ # Checks for opportunities to use `assert_output`.
432
+ #
433
+ # @example
434
+ # # bad
435
+ # $stdout = StringIO.new
436
+ # puts object.method
437
+ # $stdout.rewind
438
+ # assert_match expected, $stdout.read
439
+ #
440
+ # # good
441
+ # assert_output(expected) { puts object.method }
442
+ #
443
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#18
444
+ class RuboCop::Cop::Minitest::AssertOutput < ::RuboCop::Cop::Base
445
+ include ::RuboCop::Cop::VisibilityHelp
446
+ include ::RuboCop::Cop::DefNode
447
+ include ::RuboCop::Cop::MinitestExplorationHelpers
448
+
449
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#24
450
+ def on_gvasgn(node); end
451
+
452
+ private
453
+
454
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#38
455
+ def find_test_case(node); end
456
+
457
+ # @return [Boolean]
458
+ #
459
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#42
460
+ def references_gvar?(assertion, gvar_name); end
461
+ end
462
+
463
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#21
464
+ RuboCop::Cop::Minitest::AssertOutput::MSG = T.let(T.unsafe(nil), String)
465
+
466
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_output.rb#22
467
+ RuboCop::Cop::Minitest::AssertOutput::OUTPUT_GLOBAL_VARIABLES = T.let(T.unsafe(nil), Array)
468
+
469
+ # Enforces the test to use `assert_path_exists` instead of using `assert(File.exist?(path))`.
470
+ #
471
+ # @example
472
+ # # bad
473
+ # assert(File.exist?(path))
474
+ # assert(File.exist?(path), 'message')
475
+ #
476
+ # # good
477
+ # assert_path_exists(path)
478
+ # assert_path_exists(path, 'message')
479
+ #
480
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#17
481
+ class RuboCop::Cop::Minitest::AssertPathExists < ::RuboCop::Cop::Base
482
+ extend ::RuboCop::Cop::AutoCorrector
483
+
484
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#23
485
+ def assert_file_exists(param0 = T.unsafe(nil)); end
486
+
487
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#30
488
+ def on_send(node); end
489
+
490
+ private
491
+
492
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#45
493
+ def build_good_method(node, path, message); end
494
+ end
495
+
496
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#20
497
+ RuboCop::Cop::Minitest::AssertPathExists::MSG = T.let(T.unsafe(nil), String)
498
+
499
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_path_exists.rb#21
500
+ RuboCop::Cop::Minitest::AssertPathExists::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
501
+
502
+ # Enforces the test to use `assert_predicate`
503
+ # instead of using `assert(obj.a_predicate_method?)`.
504
+ #
505
+ # @example
506
+ # # bad
507
+ # assert(obj.one?)
508
+ # assert(obj.one?, 'message')
509
+ #
510
+ # # good
511
+ # assert_predicate(obj, :one?)
512
+ # assert_predicate(obj, :one?, 'message')
513
+ #
514
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_predicate.rb#18
515
+ class RuboCop::Cop::Minitest::AssertPredicate < ::RuboCop::Cop::Base
516
+ include ::RuboCop::Cop::RangeHelp
517
+ include ::RuboCop::Cop::ArgumentRangeHelper
518
+ include ::RuboCop::Cop::Minitest::PredicateAssertionHandleable
519
+ extend ::RuboCop::Cop::AutoCorrector
520
+
521
+ private
522
+
523
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_predicate.rb#28
524
+ def assertion_type; end
525
+ end
526
+
527
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_predicate.rb#23
528
+ RuboCop::Cop::Minitest::AssertPredicate::MSG = T.let(T.unsafe(nil), String)
529
+
530
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_predicate.rb#24
531
+ RuboCop::Cop::Minitest::AssertPredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
532
+
533
+ # Enforces the block body of `assert_raises { ... }` to be reduced to only the raising code.
534
+ #
535
+ # @example
536
+ # # bad
537
+ # assert_raises(MyError) do
538
+ # foo
539
+ # bar
540
+ # end
541
+ #
542
+ # # good
543
+ # assert_raises(MyError) do
544
+ # foo
545
+ # end
546
+ #
547
+ # # good
548
+ # assert_raises(MyError) do
549
+ # foo do
550
+ # bar
551
+ # baz
552
+ # end
553
+ # end
554
+ #
555
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_compound_body.rb#28
556
+ class RuboCop::Cop::Minitest::AssertRaisesCompoundBody < ::RuboCop::Cop::Base
557
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_compound_body.rb#31
558
+ def on_block(node); end
559
+
560
+ private
561
+
562
+ # @return [Boolean]
563
+ #
564
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_compound_body.rb#39
565
+ def multi_statement_begin?(node); end
566
+ end
567
+
568
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_compound_body.rb#29
569
+ RuboCop::Cop::Minitest::AssertRaisesCompoundBody::MSG = T.let(T.unsafe(nil), String)
570
+
571
+ # Checks for `assert_raises` with arguments of regular expression literals.
572
+ # Arguments should be exception classes.
573
+ # Optionally the last argument can be a custom message string to help explain failures.
574
+ # Either way, it's not the argument that `exception.message` is compared to.
575
+ # The raised exception is returned and can be used
576
+ # to match against a regular expression.
577
+ #
578
+ # @example
579
+ #
580
+ # # bad
581
+ # assert_raises FooError, /some message/ do
582
+ # obj.occur_error
583
+ # end
584
+ #
585
+ # # good
586
+ # exception = assert_raises FooError do
587
+ # obj.occur_error
588
+ # end
589
+ # assert_match(/some message/, exception.message)
590
+ #
591
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_with_regexp_argument.rb#26
592
+ class RuboCop::Cop::Minitest::AssertRaisesWithRegexpArgument < ::RuboCop::Cop::Base
593
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_with_regexp_argument.rb#30
594
+ def on_send(node); end
595
+ end
596
+
597
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_with_regexp_argument.rb#27
598
+ RuboCop::Cop::Minitest::AssertRaisesWithRegexpArgument::MSG = T.let(T.unsafe(nil), String)
599
+
600
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_raises_with_regexp_argument.rb#28
601
+ RuboCop::Cop::Minitest::AssertRaisesWithRegexpArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
602
+
603
+ # Enforces the use of `assert_respond_to(object, :do_something)`
604
+ # over `assert(object.respond_to?(:do_something))`.
605
+ #
606
+ # @example
607
+ # # bad
608
+ # assert(object.respond_to?(:do_something))
609
+ # assert(object.respond_to?(:do_something), 'message')
610
+ # assert(respond_to?(:do_something))
611
+ #
612
+ # # good
613
+ # assert_respond_to(object, :do_something)
614
+ # assert_respond_to(object, :do_something, 'message')
615
+ # assert_respond_to(self, :do_something)
616
+ #
617
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_respond_to.rb#20
618
+ class RuboCop::Cop::Minitest::AssertRespondTo < ::RuboCop::Cop::Base
619
+ include ::RuboCop::Cop::RangeHelp
620
+ include ::RuboCop::Cop::ArgumentRangeHelper
621
+ extend ::RuboCop::Cop::MinitestCopRule
622
+ extend ::RuboCop::Cop::AutoCorrector
623
+
624
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
625
+ def autocorrect(corrector, node, arguments); end
626
+
627
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
628
+ def on_send(node); end
629
+
630
+ private
631
+
632
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
633
+ def correct_receiver(receiver); end
634
+
635
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
636
+ def new_arguments(arguments); end
637
+
638
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
639
+ def offense_message(arguments); end
640
+ end
641
+
642
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
643
+ RuboCop::Cop::Minitest::AssertRespondTo::MSG = T.let(T.unsafe(nil), String)
644
+
645
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
646
+ RuboCop::Cop::Minitest::AssertRespondTo::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
647
+
648
+ # Enforces the use of `assert_same(expected, actual)`
649
+ # over `assert(expected.equal?(actual))`.
650
+ #
651
+ # NOTE: Use `assert_same` only when there is a need to compare by identity.
652
+ # Otherwise, use `assert_equal`.
653
+ #
654
+ # @example
655
+ # # bad
656
+ # assert(expected.equal?(actual))
657
+ # assert_equal(expected.object_id, actual.object_id)
658
+ #
659
+ # # good
660
+ # assert_same(expected, actual)
661
+ #
662
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#20
663
+ class RuboCop::Cop::Minitest::AssertSame < ::RuboCop::Cop::Base
664
+ extend ::RuboCop::Cop::AutoCorrector
665
+
666
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#32
667
+ def assert_equal_with_object_id?(param0 = T.unsafe(nil)); end
668
+
669
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#26
670
+ def assert_with_equal?(param0 = T.unsafe(nil)); end
671
+
672
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#40
673
+ def on_send(node); end
674
+
675
+ private
676
+
677
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#58
678
+ def message(expected_node, actual_node, message_node); end
679
+
680
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#63
681
+ def remove_method_call(send_node, corrector); end
682
+ end
683
+
684
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#23
685
+ RuboCop::Cop::Minitest::AssertSame::MSG = T.let(T.unsafe(nil), String)
686
+
687
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_same.rb#24
688
+ RuboCop::Cop::Minitest::AssertSame::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
689
+
690
+ # Enforces the test to use `assert_silent { ... }`
691
+ # instead of using `assert_output('', '') { ... }`.
692
+ #
693
+ # @example
694
+ # # bad
695
+ # assert_output('', '') { puts object.do_something }
696
+ #
697
+ # # good
698
+ # assert_silent { puts object.do_something }
699
+ #
700
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_silent.rb#16
701
+ class RuboCop::Cop::Minitest::AssertSilent < ::RuboCop::Cop::Base
702
+ extend ::RuboCop::Cop::AutoCorrector
703
+
704
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_silent.rb#21
705
+ def assert_silent_candidate?(param0 = T.unsafe(nil)); end
706
+
707
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_silent.rb#29
708
+ def on_block(node); end
709
+
710
+ private
711
+
712
+ # @return [Boolean]
713
+ #
714
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_silent.rb#41
715
+ def empty_string?(node); end
716
+ end
717
+
718
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_silent.rb#19
719
+ RuboCop::Cop::Minitest::AssertSilent::MSG = T.let(T.unsafe(nil), String)
720
+
721
+ # Enforces the test to use `assert(actual)` instead of using `assert_equal(true, actual)`.
722
+ #
723
+ # @example
724
+ # # bad
725
+ # assert_equal(true, actual)
726
+ # assert_equal(true, actual, 'message')
727
+ #
728
+ # # good
729
+ # assert(actual)
730
+ # assert(actual, 'message')
731
+ #
732
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_truthy.rb#27
733
+ class RuboCop::Cop::Minitest::AssertTruthy < ::RuboCop::Cop::Base
734
+ include ::RuboCop::Cop::RangeHelp
735
+ include ::RuboCop::Cop::ArgumentRangeHelper
736
+ extend ::RuboCop::Cop::AutoCorrector
737
+
738
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_truthy.rb#34
739
+ def assert_equal_with_truthy(param0 = T.unsafe(nil)); end
740
+
741
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_truthy.rb#38
742
+ def on_send(node); end
743
+ end
744
+
745
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_truthy.rb#31
746
+ RuboCop::Cop::Minitest::AssertTruthy::MSG = T.let(T.unsafe(nil), String)
747
+
748
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_truthy.rb#32
749
+ RuboCop::Cop::Minitest::AssertTruthy::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
750
+
751
+ # Tries to detect when a user accidentally used
752
+ # `assert` when they meant to use `assert_equal`.
753
+ #
754
+ # NOTE: The second argument to the `assert` method named `message` and `msg` is allowed.
755
+ # Because their names are inferred as message arguments.
756
+ #
757
+ # @example
758
+ # # bad
759
+ # assert(3, my_list.length)
760
+ # assert(expected, actual)
761
+ #
762
+ # # good
763
+ # assert_equal(3, my_list.length)
764
+ # assert_equal(expected, actual)
765
+ # assert(foo, 'message')
766
+ # assert(foo, message)
767
+ # assert(foo, msg)
768
+ #
769
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#28
770
+ class RuboCop::Cop::Minitest::AssertWithExpectedArgument < ::RuboCop::Cop::Base
771
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#33
772
+ def assert_with_two_arguments?(param0 = T.unsafe(nil)); end
773
+
774
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#37
775
+ def on_send(node); end
776
+ end
777
+
778
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#31
779
+ RuboCop::Cop::Minitest::AssertWithExpectedArgument::MESSAGE_VARIABLES = T.let(T.unsafe(nil), Array)
780
+
781
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#29
782
+ RuboCop::Cop::Minitest::AssertWithExpectedArgument::MSG = T.let(T.unsafe(nil), String)
783
+
784
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assert_with_expected_argument.rb#30
785
+ RuboCop::Cop::Minitest::AssertWithExpectedArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
786
+
787
+ # Checks for usage of assertions in lifecycle hooks.
788
+ #
789
+ # @example
790
+ # # bad
791
+ # class FooTest < Minitest::Test
792
+ # def setup
793
+ # assert_equal(foo, bar)
794
+ # end
795
+ # end
796
+ #
797
+ # # good
798
+ # class FooTest < Minitest::Test
799
+ # def test_something
800
+ # assert_equal(foo, bar)
801
+ # end
802
+ # end
803
+ #
804
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb#23
805
+ class RuboCop::Cop::Minitest::AssertionInLifecycleHook < ::RuboCop::Cop::Base
806
+ include ::RuboCop::Cop::VisibilityHelp
807
+ include ::RuboCop::Cop::DefNode
808
+ include ::RuboCop::Cop::MinitestExplorationHelpers
809
+
810
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb#28
811
+ def on_class(class_node); end
812
+ end
813
+
814
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/assertion_in_lifecycle_hook.rb#26
815
+ RuboCop::Cop::Minitest::AssertionInLifecycleHook::MSG = T.let(T.unsafe(nil), String)
816
+
817
+ # If a Minitest class inherits from another class,
818
+ # it will also inherit its methods causing Minitest to run the parent's tests methods twice.
819
+ #
820
+ # This cop detects when there are two tests classes, one inherits from the other, and both have tests methods.
821
+ # This cop will add an offense to the Child class in such a case.
822
+ #
823
+ # @example
824
+ # # bad
825
+ # class ParentTest < Minitest::Test
826
+ # def test_parent # it will run this test twice.
827
+ # end
828
+ # end
829
+ #
830
+ # class ChildTest < ParentTest
831
+ # def test_child
832
+ # end
833
+ # end
834
+ #
835
+ # # good
836
+ # class ParentTest < Minitest::Test
837
+ # def test_parent
838
+ # end
839
+ # end
840
+ #
841
+ # class ChildTest < Minitest::Test
842
+ # def test_child
843
+ # end
844
+ # end
845
+ #
846
+ # # good
847
+ # class ParentTest < Minitest::Test
848
+ # end
849
+ #
850
+ # class ChildTest
851
+ # def test_child
852
+ # end
853
+ #
854
+ # def test_parent
855
+ # end
856
+ # end
857
+ #
858
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/duplicate_test_run.rb#48
859
+ class RuboCop::Cop::Minitest::DuplicateTestRun < ::RuboCop::Cop::Base
860
+ include ::RuboCop::Cop::VisibilityHelp
861
+ include ::RuboCop::Cop::DefNode
862
+ include ::RuboCop::Cop::MinitestExplorationHelpers
863
+
864
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/duplicate_test_run.rb#53
865
+ def on_class(class_node); end
866
+
867
+ private
868
+
869
+ # @return [Boolean]
870
+ #
871
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/duplicate_test_run.rb#64
872
+ def parent_class_has_test_methods?(class_node); end
873
+
874
+ # @return [Boolean]
875
+ #
876
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/duplicate_test_run.rb#78
877
+ def test_methods?(class_node); end
878
+ end
879
+
880
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/duplicate_test_run.rb#51
881
+ RuboCop::Cop::Minitest::DuplicateTestRun::MSG = T.let(T.unsafe(nil), String)
882
+
883
+ # Enforces empty line before assertion methods because it separates assertion phase.
884
+ #
885
+ # @example
886
+ #
887
+ # # bad
888
+ # do_something
889
+ # assert_equal(expected, actual)
890
+ #
891
+ # # good
892
+ # do_something
893
+ #
894
+ # assert_equal(expected, actual)
895
+ #
896
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#19
897
+ class RuboCop::Cop::Minitest::EmptyLineBeforeAssertionMethods < ::RuboCop::Cop::Base
898
+ include ::RuboCop::Cop::VisibilityHelp
899
+ include ::RuboCop::Cop::DefNode
900
+ include ::RuboCop::Cop::MinitestExplorationHelpers
901
+ include ::RuboCop::Cop::RangeHelp
902
+ extend ::RuboCop::Cop::AutoCorrector
903
+
904
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#27
905
+ def on_send(node); end
906
+
907
+ private
908
+
909
+ # @return [Boolean]
910
+ #
911
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#52
912
+ def accept_previous_line?(previous_line_node, node); end
913
+
914
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#43
915
+ def assertion_method(node); end
916
+
917
+ # @return [Boolean]
918
+ #
919
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#73
920
+ def heredoc?(last_argument); end
921
+
922
+ # @return [Boolean]
923
+ #
924
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#77
925
+ def no_empty_line?(previous_line_node, node); end
926
+
927
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#87
928
+ def register_offense(node, previous_line_node); end
929
+
930
+ # @return [Boolean]
931
+ #
932
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#63
933
+ def use_assertion_method_at_last_of_block?(node); end
934
+
935
+ # @return [Boolean]
936
+ #
937
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#59
938
+ def use_heredoc_argument?(node); end
939
+ end
940
+
941
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/empty_line_before_assertion_methods.rb#24
942
+ RuboCop::Cop::Minitest::EmptyLineBeforeAssertionMethods::MSG = T.let(T.unsafe(nil), String)
943
+
944
+ # Checks for deprecated global expectations
945
+ # and autocorrects them to use expect format.
946
+ #
947
+ # @example EnforcedStyle: any (default)
948
+ # # bad
949
+ # musts.must_equal expected_musts
950
+ # wonts.wont_match expected_wonts
951
+ # musts.must_raise TypeError
952
+ #
953
+ # # good
954
+ # _(musts).must_equal expected_musts
955
+ # _(wonts).wont_match expected_wonts
956
+ # _ { musts }.must_raise TypeError
957
+ #
958
+ # expect(musts).must_equal expected_musts
959
+ # expect(wonts).wont_match expected_wonts
960
+ # expect { musts }.must_raise TypeError
961
+ #
962
+ # value(musts).must_equal expected_musts
963
+ # value(wonts).wont_match expected_wonts
964
+ # value { musts }.must_raise TypeError
965
+ # @example EnforcedStyle: _
966
+ # # bad
967
+ # musts.must_equal expected_musts
968
+ # wonts.wont_match expected_wonts
969
+ # musts.must_raise TypeError
970
+ #
971
+ # expect(musts).must_equal expected_musts
972
+ # expect(wonts).wont_match expected_wonts
973
+ # expect { musts }.must_raise TypeError
974
+ #
975
+ # value(musts).must_equal expected_musts
976
+ # value(wonts).wont_match expected_wonts
977
+ # value { musts }.must_raise TypeError
978
+ #
979
+ # # good
980
+ # _(musts).must_equal expected_musts
981
+ # _(wonts).wont_match expected_wonts
982
+ # _ { musts }.must_raise TypeError
983
+ # @example EnforcedStyle: expect
984
+ # # bad
985
+ # musts.must_equal expected_musts
986
+ # wonts.wont_match expected_wonts
987
+ # musts.must_raise TypeError
988
+ #
989
+ # _(musts).must_equal expected_musts
990
+ # _(wonts).wont_match expected_wonts
991
+ # _ { musts }.must_raise TypeError
992
+ #
993
+ # value(musts).must_equal expected_musts
994
+ # value(wonts).wont_match expected_wonts
995
+ # value { musts }.must_raise TypeError
996
+ #
997
+ # # good
998
+ # expect(musts).must_equal expected_musts
999
+ # expect(wonts).wont_match expected_wonts
1000
+ # expect { musts }.must_raise TypeError
1001
+ # @example EnforcedStyle: value
1002
+ # # bad
1003
+ # musts.must_equal expected_musts
1004
+ # wonts.wont_match expected_wonts
1005
+ # musts.must_raise TypeError
1006
+ #
1007
+ # _(musts).must_equal expected_musts
1008
+ # _(wonts).wont_match expected_wonts
1009
+ # _ { musts }.must_raise TypeError
1010
+ #
1011
+ # expect(musts).must_equal expected_musts
1012
+ # expect(wonts).wont_match expected_wonts
1013
+ # expect { musts }.must_raise TypeError
1014
+ #
1015
+ # # good
1016
+ # value(musts).must_equal expected_musts
1017
+ # value(wonts).wont_match expected_wonts
1018
+ # value { musts }.must_raise TypeError
1019
+ #
1020
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#84
1021
+ class RuboCop::Cop::Minitest::GlobalExpectations < ::RuboCop::Cop::Base
1022
+ include ::RuboCop::Cop::ConfigurableEnforcedStyle
1023
+ extend ::RuboCop::Cop::AutoCorrector
1024
+
1025
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#120
1026
+ def block_receiver?(param0 = T.unsafe(nil)); end
1027
+
1028
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#108
1029
+ def on_send(node); end
1030
+
1031
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#124
1032
+ def value_receiver?(param0 = T.unsafe(nil)); end
1033
+
1034
+ private
1035
+
1036
+ # @return [Boolean]
1037
+ #
1038
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#128
1039
+ def method_allowed?(method); end
1040
+
1041
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#132
1042
+ def preferred_method; end
1043
+
1044
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#136
1045
+ def preferred_receiver(node); end
1046
+
1047
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#147
1048
+ def register_offense(node, method); end
1049
+ end
1050
+
1051
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#99
1052
+ RuboCop::Cop::Minitest::GlobalExpectations::BLOCK_MATCHERS = T.let(T.unsafe(nil), Array)
1053
+
1054
+ # There are aliases for the `_` method - `expect` and `value`
1055
+ #
1056
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#106
1057
+ RuboCop::Cop::Minitest::GlobalExpectations::DSL_METHODS = T.let(T.unsafe(nil), Array)
1058
+
1059
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#88
1060
+ RuboCop::Cop::Minitest::GlobalExpectations::MSG = T.let(T.unsafe(nil), String)
1061
+
1062
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#103
1063
+ RuboCop::Cop::Minitest::GlobalExpectations::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1064
+
1065
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/global_expectations.rb#90
1066
+ RuboCop::Cop::Minitest::GlobalExpectations::VALUE_MATCHERS = T.let(T.unsafe(nil), Array)
1067
+
1068
+ # Common functionality for `Minitest/AssertInstanceOf` and `Minitest/RefuteInstanceOf` cops.
1069
+ #
1070
+ # @api private
1071
+ #
1072
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#8
1073
+ module RuboCop::Cop::Minitest::InstanceOfAssertionHandleable
1074
+ include ::RuboCop::Cop::RangeHelp
1075
+ include ::RuboCop::Cop::ArgumentRangeHelper
1076
+
1077
+ private
1078
+
1079
+ # @api private
1080
+ #
1081
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#30
1082
+ def build_required_arguments(node, method_name, first_capture, second_capture); end
1083
+
1084
+ # @api private
1085
+ #
1086
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#15
1087
+ def investigate(node, assertion_type); end
1088
+
1089
+ # @api private
1090
+ #
1091
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#38
1092
+ def replacement_range(node, method_name); end
1093
+ end
1094
+
1095
+ # @api private
1096
+ #
1097
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/instance_of_assertion_handleable.rb#11
1098
+ RuboCop::Cop::Minitest::InstanceOfAssertionHandleable::MSG = T.let(T.unsafe(nil), String)
1099
+
1100
+ # Checks that lifecycle hooks are declared in the order in which they will be executed.
1101
+ #
1102
+ # @example
1103
+ # # bad
1104
+ # class FooTest < Minitest::Test
1105
+ # def teardown; end
1106
+ # def setup; end
1107
+ # end
1108
+ #
1109
+ # # good
1110
+ # class FooTest < Minitest::Test
1111
+ # def setup; end
1112
+ # def teardown; end
1113
+ # end
1114
+ #
1115
+ # # bad (after test cases)
1116
+ # class FooTest < Minitest::Test
1117
+ # def test_something
1118
+ # assert foo
1119
+ # end
1120
+ # def setup; end
1121
+ # def teardown; end
1122
+ # end
1123
+ #
1124
+ # # good
1125
+ # class FooTest < Minitest::Test
1126
+ # def setup; end
1127
+ # def teardown; end
1128
+ # def test_something
1129
+ # assert foo
1130
+ # end
1131
+ # end
1132
+ #
1133
+ # # good (after non test case methods)
1134
+ # class FooTest < Minitest::Test
1135
+ # def do_something; end
1136
+ # def setup; end
1137
+ # def teardown; end
1138
+ # end
1139
+ #
1140
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#46
1141
+ class RuboCop::Cop::Minitest::LifecycleHooksOrder < ::RuboCop::Cop::Base
1142
+ include ::RuboCop::Cop::VisibilityHelp
1143
+ include ::RuboCop::Cop::DefNode
1144
+ include ::RuboCop::Cop::MinitestExplorationHelpers
1145
+ include ::RuboCop::Cop::RangeHelp
1146
+ extend ::RuboCop::Cop::AutoCorrector
1147
+
1148
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#60
1149
+ def on_class(class_node); end
1150
+
1151
+ private
1152
+
1153
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#90
1154
+ def autocorrect(corrector, previous_node, node); end
1155
+
1156
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#84
1157
+ def hooks_and_test_cases(class_node); end
1158
+ end
1159
+
1160
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#55
1161
+ RuboCop::Cop::Minitest::LifecycleHooksOrder::HOOKS_ORDER_MAP = T.let(T.unsafe(nil), Hash)
1162
+
1163
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#51
1164
+ RuboCop::Cop::Minitest::LifecycleHooksOrder::MSG = T.let(T.unsafe(nil), String)
1165
+
1166
+ # Regular method's position should be last.
1167
+ #
1168
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/lifecycle_hooks_order.rb#54
1169
+ RuboCop::Cop::Minitest::LifecycleHooksOrder::REGULAR_METHOD_POSITION = T.let(T.unsafe(nil), Integer)
1170
+
1171
+ # Enforces correct order of expected and
1172
+ # actual arguments for `assert_equal`.
1173
+ #
1174
+ # @example
1175
+ # # bad
1176
+ # assert_equal foo, 2
1177
+ # assert_equal foo, [1, 2]
1178
+ # assert_equal foo, [1, 2], 'message'
1179
+ #
1180
+ # # good
1181
+ # assert_equal 2, foo
1182
+ # assert_equal [1, 2], foo
1183
+ # assert_equal [1, 2], foo, 'message'
1184
+ #
1185
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#20
1186
+ class RuboCop::Cop::Minitest::LiteralAsActualArgument < ::RuboCop::Cop::Base
1187
+ include ::RuboCop::Cop::RangeHelp
1188
+ include ::RuboCop::Cop::ArgumentRangeHelper
1189
+ extend ::RuboCop::Cop::AutoCorrector
1190
+
1191
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#27
1192
+ def on_send(node); end
1193
+
1194
+ private
1195
+
1196
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#41
1197
+ def autocorrect(corrector, node, expected, actual); end
1198
+
1199
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#54
1200
+ def wrap_with_parentheses(corrector, node); end
1201
+ end
1202
+
1203
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#24
1204
+ RuboCop::Cop::Minitest::LiteralAsActualArgument::MSG = T.let(T.unsafe(nil), String)
1205
+
1206
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/literal_as_actual_argument.rb#25
1207
+ RuboCop::Cop::Minitest::LiteralAsActualArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1208
+
1209
+ # Checks if test cases contain too many assertion calls. If conditional code with assertions
1210
+ # is used, the branch with maximum assertions is counted.
1211
+ # The maximum allowed assertion calls is configurable.
1212
+ #
1213
+ # @example Max: 1
1214
+ # # bad
1215
+ # class FooTest < Minitest::Test
1216
+ # def test_asserts_twice
1217
+ # assert_equal(42, do_something)
1218
+ # assert_empty(array)
1219
+ # end
1220
+ # end
1221
+ #
1222
+ # # good
1223
+ # class FooTest < Minitest::Test
1224
+ # def test_asserts_once
1225
+ # assert_equal(42, do_something)
1226
+ # end
1227
+ #
1228
+ # def test_another_asserts_once
1229
+ # assert_empty(array)
1230
+ # end
1231
+ # end
1232
+ #
1233
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#30
1234
+ class RuboCop::Cop::Minitest::MultipleAssertions < ::RuboCop::Cop::Base
1235
+ include ::RuboCop::Cop::ConfigurableMax
1236
+ include ::RuboCop::Cop::VisibilityHelp
1237
+ include ::RuboCop::Cop::DefNode
1238
+ include ::RuboCop::Cop::MinitestExplorationHelpers
1239
+
1240
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#36
1241
+ def on_class(class_node); end
1242
+
1243
+ private
1244
+
1245
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#53
1246
+ def assertions_count(node); end
1247
+
1248
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#61
1249
+ def assertions_count_based_on_type(node); end
1250
+
1251
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#76
1252
+ def assertions_count_in_assignment(node); end
1253
+
1254
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#94
1255
+ def assertions_count_in_branches(branches); end
1256
+
1257
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#98
1258
+ def max_assertions; end
1259
+ end
1260
+
1261
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/multiple_assertions.rb#34
1262
+ RuboCop::Cop::Minitest::MultipleAssertions::MSG = T.let(T.unsafe(nil), String)
1263
+
1264
+ # Common functionality for `AssertNil` and `RefuteNil` cops.
1265
+ #
1266
+ # @api private
1267
+ #
1268
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#8
1269
+ module RuboCop::Cop::Minitest::NilAssertionHandleable
1270
+ private
1271
+
1272
+ # @api private
1273
+ #
1274
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#35
1275
+ def autocorrect(corrector, node, actual); end
1276
+
1277
+ # @api private
1278
+ #
1279
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#21
1280
+ def build_message(node, actual, message); end
1281
+
1282
+ # @api private
1283
+ # @return [Boolean]
1284
+ #
1285
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#45
1286
+ def comparison_or_predicate_assertion_method?(node); end
1287
+
1288
+ # @api private
1289
+ #
1290
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#13
1291
+ def register_offense(node, actual, message); end
1292
+ end
1293
+
1294
+ # @api private
1295
+ #
1296
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/nil_assertion_handleable.rb#9
1297
+ RuboCop::Cop::Minitest::NilAssertionHandleable::MSG = T.let(T.unsafe(nil), String)
1298
+
1299
+ # Checks if test cases contain any assertion calls.
1300
+ #
1301
+ # @example
1302
+ # # bad
1303
+ # class FooTest < Minitest::Test
1304
+ # def test_the_truth
1305
+ # end
1306
+ # end
1307
+ #
1308
+ # # good
1309
+ # class FooTest < Minitest::Test
1310
+ # def test_the_truth
1311
+ # assert true
1312
+ # end
1313
+ # end
1314
+ #
1315
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/no_assertions.rb#22
1316
+ class RuboCop::Cop::Minitest::NoAssertions < ::RuboCop::Cop::Base
1317
+ include ::RuboCop::Cop::VisibilityHelp
1318
+ include ::RuboCop::Cop::DefNode
1319
+ include ::RuboCop::Cop::MinitestExplorationHelpers
1320
+
1321
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/no_assertions.rb#27
1322
+ def on_class(class_node); end
1323
+ end
1324
+
1325
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/no_assertions.rb#25
1326
+ RuboCop::Cop::Minitest::NoAssertions::MSG = T.let(T.unsafe(nil), String)
1327
+
1328
+ # Checks if test class contains any test cases.
1329
+ #
1330
+ # @example
1331
+ # # bad
1332
+ # class FooTest < Minitest::Test
1333
+ # def do_something
1334
+ # end
1335
+ # end
1336
+ #
1337
+ # # good
1338
+ # class FooTest < Minitest::Test
1339
+ # def test_something
1340
+ # assert true
1341
+ # end
1342
+ # end
1343
+ #
1344
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/no_test_cases.rb#22
1345
+ class RuboCop::Cop::Minitest::NoTestCases < ::RuboCop::Cop::Base
1346
+ include ::RuboCop::Cop::VisibilityHelp
1347
+ include ::RuboCop::Cop::DefNode
1348
+ include ::RuboCop::Cop::MinitestExplorationHelpers
1349
+
1350
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/no_test_cases.rb#27
1351
+ def on_class(node); end
1352
+ end
1353
+
1354
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/no_test_cases.rb#25
1355
+ RuboCop::Cop::Minitest::NoTestCases::MSG = T.let(T.unsafe(nil), String)
1356
+
1357
+ # Checks for the use of test methods outside of a test class.
1358
+ #
1359
+ # Test methods should be defined within a test class to ensure their execution.
1360
+ #
1361
+ # NOTE: This cop assumes that classes whose superclass name includes the word
1362
+ # "`Test`" are test classes, in order to prevent false positives.
1363
+ #
1364
+ # @example
1365
+ #
1366
+ # # bad
1367
+ # class FooTest < Minitest::Test
1368
+ # end
1369
+ # def test_method_should_be_inside_test_class
1370
+ # end
1371
+ #
1372
+ # # good
1373
+ # class FooTest < Minitest::Test
1374
+ # def test_method_should_be_inside_test_class
1375
+ # end
1376
+ # end
1377
+ #
1378
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/non_executable_test_method.rb#27
1379
+ class RuboCop::Cop::Minitest::NonExecutableTestMethod < ::RuboCop::Cop::Base
1380
+ include ::RuboCop::Cop::VisibilityHelp
1381
+ include ::RuboCop::Cop::DefNode
1382
+ include ::RuboCop::Cop::MinitestExplorationHelpers
1383
+
1384
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/non_executable_test_method.rb#32
1385
+ def on_def(node); end
1386
+
1387
+ private
1388
+
1389
+ # @return [Boolean]
1390
+ #
1391
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/non_executable_test_method.rb#47
1392
+ def possible_test_class?(node); end
1393
+
1394
+ # @return [Boolean]
1395
+ #
1396
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/non_executable_test_method.rb#41
1397
+ def use_test_class?; end
1398
+ end
1399
+
1400
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/non_executable_test_method.rb#30
1401
+ RuboCop::Cop::Minitest::NonExecutableTestMethod::MSG = T.let(T.unsafe(nil), String)
1402
+
1403
+ # Detects non `public` (marked as `private` or `protected`) test methods.
1404
+ # Minitest runs only test methods which are `public`.
1405
+ #
1406
+ # @example
1407
+ # # bad
1408
+ # class FooTest
1409
+ # private # or protected
1410
+ # def test_does_something
1411
+ # assert_equal 42, do_something
1412
+ # end
1413
+ # end
1414
+ #
1415
+ # # good
1416
+ # class FooTest
1417
+ # def test_does_something
1418
+ # assert_equal 42, do_something
1419
+ # end
1420
+ # end
1421
+ #
1422
+ # # good (not a test case name)
1423
+ # class FooTest
1424
+ # private # or protected
1425
+ # def does_something
1426
+ # assert_equal 42, do_something
1427
+ # end
1428
+ # end
1429
+ #
1430
+ # # good (no assertions)
1431
+ # class FooTest
1432
+ # private # or protected
1433
+ # def test_does_something
1434
+ # do_something
1435
+ # end
1436
+ # end
1437
+ #
1438
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/non_public_test_method.rb#41
1439
+ class RuboCop::Cop::Minitest::NonPublicTestMethod < ::RuboCop::Cop::Base
1440
+ include ::RuboCop::Cop::VisibilityHelp
1441
+ include ::RuboCop::Cop::DefNode
1442
+ include ::RuboCop::Cop::MinitestExplorationHelpers
1443
+
1444
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/non_public_test_method.rb#47
1445
+ def on_class(node); end
1446
+ end
1447
+
1448
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/non_public_test_method.rb#45
1449
+ RuboCop::Cop::Minitest::NonPublicTestMethod::MSG = T.let(T.unsafe(nil), String)
1450
+
1451
+ # Common functionality for `Minitest/AssertPredicate` and `Minitest/RefutePredicate` cops.
1452
+ #
1453
+ # @api private
1454
+ #
1455
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#8
1456
+ module RuboCop::Cop::Minitest::PredicateAssertionHandleable
1457
+ # @api private
1458
+ #
1459
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#22
1460
+ def autocorrect(corrector, node, arguments); end
1461
+
1462
+ # @api private
1463
+ #
1464
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#11
1465
+ def on_send(node); end
1466
+
1467
+ private
1468
+
1469
+ # @api private
1470
+ #
1471
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#51
1472
+ def correct_receiver(receiver); end
1473
+
1474
+ # @api private
1475
+ #
1476
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#44
1477
+ def new_arguments(arguments); end
1478
+
1479
+ # @api private
1480
+ #
1481
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#36
1482
+ def offense_message(arguments); end
1483
+
1484
+ # @api private
1485
+ # @return [Boolean]
1486
+ #
1487
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#32
1488
+ def predicate_method?(first_argument); end
1489
+ end
1490
+
1491
+ # @api private
1492
+ #
1493
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/predicate_assertion_handleable.rb#9
1494
+ RuboCop::Cop::Minitest::PredicateAssertionHandleable::MSG = T.let(T.unsafe(nil), String)
1495
+
1496
+ # Detects redundant message argument in assertion methods.
1497
+ # The message argument `nil` is redundant because it is the default value.
1498
+ #
1499
+ # @example
1500
+ #
1501
+ # # bad
1502
+ # assert_equal(expected, actual, nil)
1503
+ #
1504
+ # # good
1505
+ # assert_equal(expected, actual)
1506
+ # assert_equal(expected, actual, 'message')
1507
+ #
1508
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/redundant_message_argument.rb#18
1509
+ class RuboCop::Cop::Minitest::RedundantMessageArgument < ::RuboCop::Cop::Base
1510
+ extend ::RuboCop::Cop::AutoCorrector
1511
+
1512
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/redundant_message_argument.rb#71
1513
+ def on_send(node); end
1514
+
1515
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/redundant_message_argument.rb#34
1516
+ def redundant_message_argument(param0 = T.unsafe(nil)); end
1517
+ end
1518
+
1519
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/redundant_message_argument.rb#21
1520
+ RuboCop::Cop::Minitest::RedundantMessageArgument::MSG = T.let(T.unsafe(nil), String)
1521
+
1522
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/redundant_message_argument.rb#23
1523
+ RuboCop::Cop::Minitest::RedundantMessageArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1524
+
1525
+ # Enforces to use `refute_empty` instead of using `refute(object.empty?)`.
1526
+ #
1527
+ # @example
1528
+ # # bad
1529
+ # refute(object.empty?)
1530
+ # refute(object.empty?, 'message')
1531
+ #
1532
+ # # good
1533
+ # refute_empty(object)
1534
+ # refute_empty(object, 'message')
1535
+ #
1536
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_empty.rb#17
1537
+ class RuboCop::Cop::Minitest::RefuteEmpty < ::RuboCop::Cop::Base
1538
+ include ::RuboCop::Cop::RangeHelp
1539
+ include ::RuboCop::Cop::ArgumentRangeHelper
1540
+ extend ::RuboCop::Cop::MinitestCopRule
1541
+ extend ::RuboCop::Cop::AutoCorrector
1542
+
1543
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
1544
+ def autocorrect(corrector, node, arguments); end
1545
+
1546
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_empty.rb#23
1547
+ def on_send(node); end
1548
+
1549
+ private
1550
+
1551
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
1552
+ def correct_receiver(receiver); end
1553
+
1554
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
1555
+ def new_arguments(arguments); end
1556
+
1557
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
1558
+ def offense_message(arguments); end
1559
+ end
1560
+
1561
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
1562
+ RuboCop::Cop::Minitest::RefuteEmpty::MSG = T.let(T.unsafe(nil), String)
1563
+
1564
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
1565
+ RuboCop::Cop::Minitest::RefuteEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1566
+
1567
+ # Enforces the use of `refute_equal(expected, object)`
1568
+ # over `assert(expected != actual)` or `assert(! expected == actual)`.
1569
+ #
1570
+ # @example
1571
+ # # bad
1572
+ # assert("rubocop-minitest" != actual)
1573
+ # refute("rubocop-minitest" == actual)
1574
+ # assert_operator("rubocop-minitest", :!=, actual)
1575
+ # refute_operator("rubocop-minitest", :==, actual)
1576
+ #
1577
+ # # good
1578
+ # refute_equal("rubocop-minitest", actual)
1579
+ #
1580
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_equal.rb#19
1581
+ class RuboCop::Cop::Minitest::RefuteEqual < ::RuboCop::Cop::Base
1582
+ include ::RuboCop::Cop::RangeHelp
1583
+ include ::RuboCop::Cop::ArgumentRangeHelper
1584
+ extend ::RuboCop::Cop::AutoCorrector
1585
+
1586
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_equal.rb#36
1587
+ def on_send(node); end
1588
+
1589
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_equal.rb#26
1590
+ def refute_equal(param0 = T.unsafe(nil)); end
1591
+ end
1592
+
1593
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_equal.rb#23
1594
+ RuboCop::Cop::Minitest::RefuteEqual::MSG = T.let(T.unsafe(nil), String)
1595
+
1596
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_equal.rb#24
1597
+ RuboCop::Cop::Minitest::RefuteEqual::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1598
+
1599
+ # Enforces the use of `refute(object)` over `assert_equal(false, object)`.
1600
+ #
1601
+ # @example
1602
+ # # bad
1603
+ # assert_equal(false, actual)
1604
+ # assert_equal(false, actual, 'message')
1605
+ #
1606
+ # assert(!test)
1607
+ # assert(!test, 'message')
1608
+ #
1609
+ # # good
1610
+ # refute(actual)
1611
+ # refute(actual, 'message')
1612
+ #
1613
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#30
1614
+ class RuboCop::Cop::Minitest::RefuteFalse < ::RuboCop::Cop::Base
1615
+ include ::RuboCop::Cop::RangeHelp
1616
+ include ::RuboCop::Cop::ArgumentRangeHelper
1617
+ extend ::RuboCop::Cop::AutoCorrector
1618
+
1619
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#38
1620
+ def assert_equal_with_false(param0 = T.unsafe(nil)); end
1621
+
1622
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#42
1623
+ def assert_with_bang_argument(param0 = T.unsafe(nil)); end
1624
+
1625
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#46
1626
+ def on_send(node); end
1627
+
1628
+ private
1629
+
1630
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#63
1631
+ def autocorrect(corrector, node, actual); end
1632
+ end
1633
+
1634
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#35
1635
+ RuboCop::Cop::Minitest::RefuteFalse::MSG_FOR_ASSERT = T.let(T.unsafe(nil), String)
1636
+
1637
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#34
1638
+ RuboCop::Cop::Minitest::RefuteFalse::MSG_FOR_ASSERT_EQUAL = T.let(T.unsafe(nil), String)
1639
+
1640
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_false.rb#36
1641
+ RuboCop::Cop::Minitest::RefuteFalse::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1642
+
1643
+ # Enforces the test to use `refute_in_delta`
1644
+ # instead of using `refute_equal` to compare floats.
1645
+ #
1646
+ # @example
1647
+ # # bad
1648
+ # refute_equal(0.2, actual)
1649
+ # refute_equal(0.2, actual, 'message')
1650
+ #
1651
+ # # good
1652
+ # refute_in_delta(0.2, actual)
1653
+ # refute_in_delta(0.2, actual, 0.001, 'message')
1654
+ #
1655
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_in_delta.rb#18
1656
+ class RuboCop::Cop::Minitest::RefuteInDelta < ::RuboCop::Cop::Base
1657
+ include ::RuboCop::Cop::InDeltaMixin
1658
+ extend ::RuboCop::Cop::AutoCorrector
1659
+
1660
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_in_delta.rb#24
1661
+ def equal_floats_call(param0 = T.unsafe(nil)); end
1662
+ end
1663
+
1664
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_in_delta.rb#22
1665
+ RuboCop::Cop::Minitest::RefuteInDelta::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1666
+
1667
+ # Enforces the test to use `refute_includes`
1668
+ # instead of using `refute(collection.include?(object))`.
1669
+ #
1670
+ # @example
1671
+ # # bad
1672
+ # refute(collection.include?(object))
1673
+ # refute(collection.include?(object), 'message')
1674
+ #
1675
+ # # good
1676
+ # refute_includes(collection, object)
1677
+ # refute_includes(collection, object, 'message')
1678
+ #
1679
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_includes.rb#18
1680
+ class RuboCop::Cop::Minitest::RefuteIncludes < ::RuboCop::Cop::Base
1681
+ include ::RuboCop::Cop::RangeHelp
1682
+ include ::RuboCop::Cop::ArgumentRangeHelper
1683
+ extend ::RuboCop::Cop::MinitestCopRule
1684
+ extend ::RuboCop::Cop::AutoCorrector
1685
+
1686
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
1687
+ def autocorrect(corrector, node, arguments); end
1688
+
1689
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
1690
+ def on_send(node); end
1691
+
1692
+ private
1693
+
1694
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
1695
+ def correct_receiver(receiver); end
1696
+
1697
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
1698
+ def new_arguments(arguments); end
1699
+
1700
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
1701
+ def offense_message(arguments); end
1702
+ end
1703
+
1704
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
1705
+ RuboCop::Cop::Minitest::RefuteIncludes::MSG = T.let(T.unsafe(nil), String)
1706
+
1707
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
1708
+ RuboCop::Cop::Minitest::RefuteIncludes::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1709
+
1710
+ # Enforces the use of `refute_instance_of(Class, object)`
1711
+ # over `refute(object.instance_of?(Class))`.
1712
+ #
1713
+ # @example
1714
+ # # bad
1715
+ # refute(object.instance_of?(Class))
1716
+ # refute(object.instance_of?(Class), 'message')
1717
+ #
1718
+ # # bad
1719
+ # refute_equal(Class, object.class)
1720
+ # refute_equal(Class, object.class, 'message')
1721
+ #
1722
+ # # good
1723
+ # refute_instance_of(Class, object)
1724
+ # refute_instance_of(Class, object, 'message')
1725
+ #
1726
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_instance_of.rb#22
1727
+ class RuboCop::Cop::Minitest::RefuteInstanceOf < ::RuboCop::Cop::Base
1728
+ include ::RuboCop::Cop::RangeHelp
1729
+ include ::RuboCop::Cop::ArgumentRangeHelper
1730
+ include ::RuboCop::Cop::Minitest::InstanceOfAssertionHandleable
1731
+ extend ::RuboCop::Cop::AutoCorrector
1732
+
1733
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_instance_of.rb#28
1734
+ def instance_of_assertion?(param0 = T.unsafe(nil)); end
1735
+
1736
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_instance_of.rb#35
1737
+ def on_send(node); end
1738
+ end
1739
+
1740
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_instance_of.rb#26
1741
+ RuboCop::Cop::Minitest::RefuteInstanceOf::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1742
+
1743
+ # Enforces the use of `refute_kind_of(Class, object)`
1744
+ # over `refute(object.kind_of?(Class))`.
1745
+ #
1746
+ # @example
1747
+ # # bad
1748
+ # refute(object.kind_of?(Class))
1749
+ # refute(object.kind_of?(Class), 'message')
1750
+ #
1751
+ # # bad
1752
+ # # `is_a?` is an alias for `kind_of?`
1753
+ # refute(object.is_of?(Class))
1754
+ # refute(object.is_of?(Class), 'message')
1755
+ #
1756
+ # # good
1757
+ # refute_kind_of(Class, object)
1758
+ # refute_kind_of(Class, object, 'message')
1759
+ #
1760
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_kind_of.rb#23
1761
+ class RuboCop::Cop::Minitest::RefuteKindOf < ::RuboCop::Cop::Base
1762
+ include ::RuboCop::Cop::RangeHelp
1763
+ include ::RuboCop::Cop::ArgumentRangeHelper
1764
+ extend ::RuboCop::Cop::MinitestCopRule
1765
+ extend ::RuboCop::Cop::AutoCorrector
1766
+
1767
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
1768
+ def autocorrect(corrector, node, arguments); end
1769
+
1770
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
1771
+ def on_send(node); end
1772
+
1773
+ private
1774
+
1775
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
1776
+ def correct_receiver(receiver); end
1777
+
1778
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
1779
+ def new_arguments(arguments); end
1780
+
1781
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
1782
+ def offense_message(arguments); end
1783
+ end
1784
+
1785
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
1786
+ RuboCop::Cop::Minitest::RefuteKindOf::MSG = T.let(T.unsafe(nil), String)
1787
+
1788
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
1789
+ RuboCop::Cop::Minitest::RefuteKindOf::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1790
+
1791
+ # Enforces the test to use `refute_match`
1792
+ # instead of using `refute(matcher.match(string))`.
1793
+ #
1794
+ # @example
1795
+ # # bad
1796
+ # refute(matcher.match(string))
1797
+ # refute(matcher.match?(string))
1798
+ # refute(matcher =~ string)
1799
+ # refute_operator(matcher, :=~, string)
1800
+ # assert_operator(matcher, :!~, string)
1801
+ # refute(matcher.match(string), 'message')
1802
+ #
1803
+ # # good
1804
+ # refute_match(matcher, string)
1805
+ # refute_match(matcher, string, 'message')
1806
+ #
1807
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#22
1808
+ class RuboCop::Cop::Minitest::RefuteMatch < ::RuboCop::Cop::Base
1809
+ include ::RuboCop::Cop::RangeHelp
1810
+ include ::RuboCop::Cop::ArgumentRangeHelper
1811
+ extend ::RuboCop::Cop::AutoCorrector
1812
+
1813
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#38
1814
+ def on_send(node); end
1815
+
1816
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#29
1817
+ def refute_match(param0 = T.unsafe(nil)); end
1818
+
1819
+ private
1820
+
1821
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#61
1822
+ def order_expected_and_actual(expected, actual); end
1823
+ end
1824
+
1825
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#26
1826
+ RuboCop::Cop::Minitest::RefuteMatch::MSG = T.let(T.unsafe(nil), String)
1827
+
1828
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_match.rb#27
1829
+ RuboCop::Cop::Minitest::RefuteMatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1830
+
1831
+ # Enforces the test to use `refute_nil` instead of using
1832
+ # `refute_equal(nil, something)`, `refute(something.nil?)`, or `refute_predicate(something, :nil?)`.
1833
+ #
1834
+ # @example
1835
+ # # bad
1836
+ # refute_equal(nil, actual)
1837
+ # refute_equal(nil, actual, 'message')
1838
+ # refute(actual.nil?)
1839
+ # refute(actual.nil?, 'message')
1840
+ # refute_predicate(object, :nil?)
1841
+ # refute_predicate(object, :nil?, 'message')
1842
+ #
1843
+ # # good
1844
+ # refute_nil(actual)
1845
+ # refute_nil(actual, 'message')
1846
+ #
1847
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#22
1848
+ class RuboCop::Cop::Minitest::RefuteNil < ::RuboCop::Cop::Base
1849
+ include ::RuboCop::Cop::RangeHelp
1850
+ include ::RuboCop::Cop::ArgumentRangeHelper
1851
+ include ::RuboCop::Cop::Minitest::NilAssertionHandleable
1852
+ extend ::RuboCop::Cop::AutoCorrector
1853
+
1854
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#30
1855
+ def nil_refutation(param0 = T.unsafe(nil)); end
1856
+
1857
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#38
1858
+ def on_send(node); end
1859
+
1860
+ private
1861
+
1862
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#46
1863
+ def assertion_type; end
1864
+ end
1865
+
1866
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#27
1867
+ RuboCop::Cop::Minitest::RefuteNil::ASSERTION_TYPE = T.let(T.unsafe(nil), String)
1868
+
1869
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_nil.rb#28
1870
+ RuboCop::Cop::Minitest::RefuteNil::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1871
+
1872
+ # Enforces the use of `refute_operator(expected, :<, actual)` over `refute(expected < actual)`.
1873
+ #
1874
+ # @example
1875
+ #
1876
+ # # bad
1877
+ # refute(expected < actual)
1878
+ #
1879
+ # # good
1880
+ # refute_operator(expected, :<, actual)
1881
+ #
1882
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#16
1883
+ class RuboCop::Cop::Minitest::RefuteOperator < ::RuboCop::Cop::Base
1884
+ extend ::RuboCop::Cop::AutoCorrector
1885
+
1886
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#23
1887
+ def on_send(node); end
1888
+
1889
+ private
1890
+
1891
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#41
1892
+ def build_new_arguments(node); end
1893
+
1894
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#52
1895
+ def range_of_arguments(node); end
1896
+ end
1897
+
1898
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#21
1899
+ RuboCop::Cop::Minitest::RefuteOperator::ALLOWED_OPERATORS = T.let(T.unsafe(nil), Array)
1900
+
1901
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#19
1902
+ RuboCop::Cop::Minitest::RefuteOperator::MSG = T.let(T.unsafe(nil), String)
1903
+
1904
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_operator.rb#20
1905
+ RuboCop::Cop::Minitest::RefuteOperator::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1906
+
1907
+ # Enforces the test to use `refute_path_exists` instead of using `refute(File.exist?(path))`.
1908
+ #
1909
+ # @example
1910
+ # # bad
1911
+ # refute(File.exist?(path))
1912
+ # refute(File.exist?(path), 'message')
1913
+ #
1914
+ # # good
1915
+ # refute_path_exists(path)
1916
+ # refute_path_exists(path, 'message')
1917
+ #
1918
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#17
1919
+ class RuboCop::Cop::Minitest::RefutePathExists < ::RuboCop::Cop::Base
1920
+ extend ::RuboCop::Cop::AutoCorrector
1921
+
1922
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#30
1923
+ def on_send(node); end
1924
+
1925
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#23
1926
+ def refute_file_exists(param0 = T.unsafe(nil)); end
1927
+
1928
+ private
1929
+
1930
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#45
1931
+ def build_good_method(node, path, message); end
1932
+ end
1933
+
1934
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#20
1935
+ RuboCop::Cop::Minitest::RefutePathExists::MSG = T.let(T.unsafe(nil), String)
1936
+
1937
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_path_exists.rb#21
1938
+ RuboCop::Cop::Minitest::RefutePathExists::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1939
+
1940
+ # Enforces the test to use `refute_predicate`
1941
+ # instead of using `refute(obj.a_predicate_method?)`.
1942
+ #
1943
+ # @example
1944
+ # # bad
1945
+ # refute(obj.one?)
1946
+ # refute(obj.one?, 'message')
1947
+ #
1948
+ # # good
1949
+ # refute_predicate(obj, :one?)
1950
+ # refute_predicate(obj, :one?, 'message')
1951
+ #
1952
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_predicate.rb#18
1953
+ class RuboCop::Cop::Minitest::RefutePredicate < ::RuboCop::Cop::Base
1954
+ include ::RuboCop::Cop::RangeHelp
1955
+ include ::RuboCop::Cop::ArgumentRangeHelper
1956
+ include ::RuboCop::Cop::Minitest::PredicateAssertionHandleable
1957
+ extend ::RuboCop::Cop::AutoCorrector
1958
+
1959
+ private
1960
+
1961
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_predicate.rb#28
1962
+ def assertion_type; end
1963
+ end
1964
+
1965
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_predicate.rb#23
1966
+ RuboCop::Cop::Minitest::RefutePredicate::MSG = T.let(T.unsafe(nil), String)
1967
+
1968
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_predicate.rb#24
1969
+ RuboCop::Cop::Minitest::RefutePredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1970
+
1971
+ # Enforces the test to use `refute_respond_to(object, :do_something)`
1972
+ # over `refute(object.respond_to?(:do_something))`.
1973
+ #
1974
+ # @example
1975
+ # # bad
1976
+ # refute(object.respond_to?(:do_something))
1977
+ # refute(object.respond_to?(:do_something), 'message')
1978
+ # refute(respond_to?(:do_something))
1979
+ #
1980
+ # # good
1981
+ # refute_respond_to(object, :do_something)
1982
+ # refute_respond_to(object, :do_something, 'message')
1983
+ # refute_respond_to(self, :do_something)
1984
+ #
1985
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_respond_to.rb#20
1986
+ class RuboCop::Cop::Minitest::RefuteRespondTo < ::RuboCop::Cop::Base
1987
+ include ::RuboCop::Cop::RangeHelp
1988
+ include ::RuboCop::Cop::ArgumentRangeHelper
1989
+ extend ::RuboCop::Cop::MinitestCopRule
1990
+ extend ::RuboCop::Cop::AutoCorrector
1991
+
1992
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#57
1993
+ def autocorrect(corrector, node, arguments); end
1994
+
1995
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#46
1996
+ def on_send(node); end
1997
+
1998
+ private
1999
+
2000
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#95
2001
+ def correct_receiver(receiver); end
2002
+
2003
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#81
2004
+ def new_arguments(arguments); end
2005
+
2006
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#67
2007
+ def offense_message(arguments); end
2008
+ end
2009
+
2010
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#43
2011
+ RuboCop::Cop::Minitest::RefuteRespondTo::MSG = T.let(T.unsafe(nil), String)
2012
+
2013
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#44
2014
+ RuboCop::Cop::Minitest::RefuteRespondTo::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
2015
+
2016
+ # Enforces the use of `refute_same(expected, object)`
2017
+ # over `refute(expected.equal?(actual))`.
2018
+ #
2019
+ # NOTE: Use `refute_same` only when there is a need to compare by identity.
2020
+ # Otherwise, use `refute_equal`.
2021
+ #
2022
+ # @example
2023
+ # # bad
2024
+ # refute(expected.equal?(actual))
2025
+ # refute_equal(expected.object_id, actual.object_id)
2026
+ #
2027
+ # # good
2028
+ # refute_same(expected, actual)
2029
+ #
2030
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#20
2031
+ class RuboCop::Cop::Minitest::RefuteSame < ::RuboCop::Cop::Base
2032
+ extend ::RuboCop::Cop::AutoCorrector
2033
+
2034
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#40
2035
+ def on_send(node); end
2036
+
2037
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#32
2038
+ def refute_equal_with_object_id?(param0 = T.unsafe(nil)); end
2039
+
2040
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#26
2041
+ def refute_with_equal?(param0 = T.unsafe(nil)); end
2042
+
2043
+ private
2044
+
2045
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#58
2046
+ def message(expected_node, actual_node, message_node); end
2047
+
2048
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#63
2049
+ def remove_method_call(send_node, corrector); end
2050
+ end
2051
+
2052
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#23
2053
+ RuboCop::Cop::Minitest::RefuteSame::MSG = T.let(T.unsafe(nil), String)
2054
+
2055
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/refute_same.rb#24
2056
+ RuboCop::Cop::Minitest::RefuteSame::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
2057
+
2058
+ # Enforces the use of `skip` instead of `return` in test methods.
2059
+ #
2060
+ # @example
2061
+ # # bad
2062
+ # def test_something
2063
+ # return if condition?
2064
+ # assert_equal(42, something)
2065
+ # end
2066
+ #
2067
+ # # good
2068
+ # def test_something
2069
+ # skip if condition?
2070
+ # assert_equal(42, something)
2071
+ # end
2072
+ #
2073
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/return_in_test_method.rb#21
2074
+ class RuboCop::Cop::Minitest::ReturnInTestMethod < ::RuboCop::Cop::Base
2075
+ include ::RuboCop::Cop::VisibilityHelp
2076
+ include ::RuboCop::Cop::DefNode
2077
+ include ::RuboCop::Cop::MinitestExplorationHelpers
2078
+ extend ::RuboCop::Cop::AutoCorrector
2079
+
2080
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/return_in_test_method.rb#27
2081
+ def on_return(node); end
2082
+
2083
+ private
2084
+
2085
+ # @return [Boolean]
2086
+ #
2087
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/return_in_test_method.rb#38
2088
+ def inside_block?(node); end
2089
+ end
2090
+
2091
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/return_in_test_method.rb#25
2092
+ RuboCop::Cop::Minitest::ReturnInTestMethod::MSG = T.let(T.unsafe(nil), String)
2093
+
2094
+ # Checks that `ensure` call even if `skip`. It is unexpected that `ensure` will be called when skipping test.
2095
+ # If conditional `skip` is used, it checks that `ensure` is also called conditionally.
2096
+ #
2097
+ # On the other hand, it accepts `skip` used in `rescue` because `ensure` may be teardown process to `begin`
2098
+ # setup process.
2099
+ #
2100
+ # @example
2101
+ #
2102
+ # # bad
2103
+ # def test_skip
2104
+ # skip 'This test is skipped.'
2105
+ #
2106
+ # assert 'foo'.present?
2107
+ # ensure
2108
+ # do_something
2109
+ # end
2110
+ #
2111
+ # # bad
2112
+ # def test_conditional_skip
2113
+ # skip 'This test is skipped.' if condition
2114
+ #
2115
+ # assert do_something
2116
+ # ensure
2117
+ # do_teardown
2118
+ # end
2119
+ #
2120
+ # # good
2121
+ # def test_skip
2122
+ # skip 'This test is skipped.'
2123
+ #
2124
+ # begin
2125
+ # assert 'foo'.present?
2126
+ # ensure
2127
+ # do_something
2128
+ # end
2129
+ # end
2130
+ #
2131
+ # # good
2132
+ # def test_conditional_skip
2133
+ # skip 'This test is skipped.' if condition
2134
+ #
2135
+ # assert do_something
2136
+ # ensure
2137
+ # if condition
2138
+ # do_teardown
2139
+ # end
2140
+ # end
2141
+ #
2142
+ # # good
2143
+ # def test_skip_is_used_in_rescue
2144
+ # do_setup
2145
+ # assert do_something
2146
+ # rescue
2147
+ # skip 'This test is skipped.'
2148
+ # ensure
2149
+ # do_teardown
2150
+ # end
2151
+ #
2152
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#64
2153
+ class RuboCop::Cop::Minitest::SkipEnsure < ::RuboCop::Cop::Base
2154
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#67
2155
+ def on_ensure(node); end
2156
+
2157
+ private
2158
+
2159
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#77
2160
+ def find_skip(node); end
2161
+
2162
+ # @return [Boolean]
2163
+ #
2164
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#81
2165
+ def use_skip_in_rescue?(skip_method); end
2166
+
2167
+ # @return [Boolean]
2168
+ #
2169
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#85
2170
+ def valid_conditional_skip?(skip_method, ensure_node); end
2171
+ end
2172
+
2173
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_ensure.rb#65
2174
+ RuboCop::Cop::Minitest::SkipEnsure::MSG = T.let(T.unsafe(nil), String)
2175
+
2176
+ # Checks for skipped tests missing the skipping reason.
2177
+ #
2178
+ # @example
2179
+ # # bad
2180
+ # skip
2181
+ # skip('')
2182
+ #
2183
+ # # bad
2184
+ # if condition?
2185
+ # skip
2186
+ # else
2187
+ # skip
2188
+ # end
2189
+ #
2190
+ # # good
2191
+ # skip("Reason why the test was skipped")
2192
+ #
2193
+ # # good
2194
+ # skip if condition?
2195
+ #
2196
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#26
2197
+ class RuboCop::Cop::Minitest::SkipWithoutReason < ::RuboCop::Cop::Base
2198
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#31
2199
+ def on_send(node); end
2200
+
2201
+ private
2202
+
2203
+ # @return [Boolean]
2204
+ #
2205
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#44
2206
+ def blank_argument?(node); end
2207
+
2208
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#49
2209
+ def conditional_parent(node); end
2210
+
2211
+ # @return [Boolean]
2212
+ #
2213
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#59
2214
+ def only_skip_branches?(node); end
2215
+ end
2216
+
2217
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#27
2218
+ RuboCop::Cop::Minitest::SkipWithoutReason::MSG = T.let(T.unsafe(nil), String)
2219
+
2220
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/skip_without_reason.rb#29
2221
+ RuboCop::Cop::Minitest::SkipWithoutReason::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
2222
+
2223
+ # Checks if test file names start with `test_` or end with `_test.rb`.
2224
+ # Files which define classes having names ending with `Test` are checked.
2225
+ # Not following this convention may result in tests not being run.
2226
+ #
2227
+ # @example
2228
+ # # bad
2229
+ # my_class.rb
2230
+ #
2231
+ # # good
2232
+ # my_class_test.rb
2233
+ # test_my_class.rb
2234
+ #
2235
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/test_file_name.rb#18
2236
+ class RuboCop::Cop::Minitest::TestFileName < ::RuboCop::Cop::Base
2237
+ include ::RuboCop::Cop::VisibilityHelp
2238
+ include ::RuboCop::Cop::DefNode
2239
+ include ::RuboCop::Cop::MinitestExplorationHelpers
2240
+
2241
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/test_file_name.rb#23
2242
+ def on_new_investigation; end
2243
+
2244
+ private
2245
+
2246
+ # @return [Boolean]
2247
+ #
2248
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/test_file_name.rb#32
2249
+ def test_file?(node); end
2250
+
2251
+ # @return [Boolean]
2252
+ #
2253
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/test_file_name.rb#38
2254
+ def valid_file_name?; end
2255
+ end
2256
+
2257
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/test_file_name.rb#21
2258
+ RuboCop::Cop::Minitest::TestFileName::MSG = T.let(T.unsafe(nil), String)
2259
+
2260
+ # Enforces that test method names start with `test_` prefix.
2261
+ # It aims to prevent tests that aren't executed by forgetting to start test method name with `test_`.
2262
+ #
2263
+ # @example
2264
+ # # bad
2265
+ # class FooTest < Minitest::Test
2266
+ # def does_something
2267
+ # assert_equal 42, do_something
2268
+ # end
2269
+ # end
2270
+ #
2271
+ # # good
2272
+ # class FooTest < Minitest::Test
2273
+ # def test_does_something
2274
+ # assert_equal 42, do_something
2275
+ # end
2276
+ # end
2277
+ #
2278
+ # # good
2279
+ # class FooTest < Minitest::Test
2280
+ # def helper_method(argument)
2281
+ # end
2282
+ # end
2283
+ #
2284
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#30
2285
+ class RuboCop::Cop::Minitest::TestMethodName < ::RuboCop::Cop::Base
2286
+ include ::RuboCop::Cop::VisibilityHelp
2287
+ include ::RuboCop::Cop::DefNode
2288
+ include ::RuboCop::Cop::MinitestExplorationHelpers
2289
+ extend ::RuboCop::Cop::AutoCorrector
2290
+
2291
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#37
2292
+ def on_class(class_node); end
2293
+
2294
+ private
2295
+
2296
+ # @return [Boolean]
2297
+ #
2298
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#53
2299
+ def offense?(node); end
2300
+
2301
+ # @return [Boolean]
2302
+ #
2303
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#59
2304
+ def public?(node); end
2305
+
2306
+ # @return [Boolean]
2307
+ #
2308
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#63
2309
+ def test_method_name?(node); end
2310
+ end
2311
+
2312
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/test_method_name.rb#35
2313
+ RuboCop::Cop::Minitest::TestMethodName::MSG = T.let(T.unsafe(nil), String)
2314
+
2315
+ # Checks for `assert_raises` has an assertion method at
2316
+ # the bottom of block because the assertion will be never reached.
2317
+ #
2318
+ # @example
2319
+ #
2320
+ # # bad
2321
+ # assert_raises FooError do
2322
+ # obj.occur_error
2323
+ # assert_equal('foo', obj.bar) # Never asserted.
2324
+ # end
2325
+ #
2326
+ # # good
2327
+ # assert_raises FooError do
2328
+ # obj.occur_error
2329
+ # end
2330
+ # assert_equal('foo', obj.bar)
2331
+ #
2332
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/unreachable_assertion.rb#23
2333
+ class RuboCop::Cop::Minitest::UnreachableAssertion < ::RuboCop::Cop::Base
2334
+ include ::RuboCop::Cop::VisibilityHelp
2335
+ include ::RuboCop::Cop::DefNode
2336
+ include ::RuboCop::Cop::MinitestExplorationHelpers
2337
+
2338
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/unreachable_assertion.rb#28
2339
+ def on_block(node); end
2340
+ end
2341
+
2342
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/unreachable_assertion.rb#26
2343
+ RuboCop::Cop::Minitest::UnreachableAssertion::MSG = T.let(T.unsafe(nil), String)
2344
+
2345
+ # Checks for a specified error in `assert_raises`.
2346
+ #
2347
+ # @example
2348
+ # # bad
2349
+ # assert_raises { raise FooException }
2350
+ # assert_raises('This should have raised') { raise FooException }
2351
+ #
2352
+ # # good
2353
+ # assert_raises(FooException) { raise FooException }
2354
+ # assert_raises(FooException, 'This should have raised') { raise FooException }
2355
+ #
2356
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/unspecified_exception.rb#17
2357
+ class RuboCop::Cop::Minitest::UnspecifiedException < ::RuboCop::Cop::Base
2358
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/unspecified_exception.rb#20
2359
+ def on_block(block_node); end
2360
+
2361
+ private
2362
+
2363
+ # @return [Boolean]
2364
+ #
2365
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/unspecified_exception.rb#29
2366
+ def unspecified_exception?(node); end
2367
+ end
2368
+
2369
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/unspecified_exception.rb#18
2370
+ RuboCop::Cop::Minitest::UnspecifiedException::MSG = T.let(T.unsafe(nil), String)
2371
+
2372
+ # Detects useless assertions (assertions that either always pass or always fail).
2373
+ #
2374
+ # @example
2375
+ # # bad
2376
+ # assert true
2377
+ # assert_equal @foo, @foo
2378
+ # assert_nil [foo, bar]
2379
+ #
2380
+ # # good
2381
+ # assert something
2382
+ # assert_equal foo, bar
2383
+ # assert_nil foo
2384
+ # assert false, "My message"
2385
+ #
2386
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#20
2387
+ class RuboCop::Cop::Minitest::UselessAssertion < ::RuboCop::Cop::Base
2388
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#35
2389
+ def on_send(node); end
2390
+
2391
+ private
2392
+
2393
+ # @return [Boolean]
2394
+ #
2395
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#67
2396
+ def empty_composite?(node); end
2397
+
2398
+ # @return [Boolean]
2399
+ #
2400
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#44
2401
+ def offense?(node); end
2402
+ end
2403
+
2404
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#21
2405
+ RuboCop::Cop::Minitest::UselessAssertion::MSG = T.let(T.unsafe(nil), String)
2406
+
2407
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#31
2408
+ RuboCop::Cop::Minitest::UselessAssertion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
2409
+
2410
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#23
2411
+ RuboCop::Cop::Minitest::UselessAssertion::SINGLE_ASSERTION_ARGUMENT_METHODS = T.let(T.unsafe(nil), Array)
2412
+
2413
+ # source://rubocop-minitest//lib/rubocop/cop/minitest/useless_assertion.rb#26
2414
+ RuboCop::Cop::Minitest::UselessAssertion::TWO_ASSERTION_ARGUMENTS_METHODS = T.let(T.unsafe(nil), Array)
2415
+
2416
+ # Provide a method to define offense rule for Minitest cops.
2417
+ #
2418
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#6
2419
+ module RuboCop::Cop::MinitestCopRule
2420
+ # Define offense rule for Minitest cops.
2421
+ #
2422
+ # @api private
2423
+ # @example
2424
+ # define_rule :assert, target_method: :match
2425
+ # define_rule :refute, target_method: :match
2426
+ # define_rule :assert, target_method: :include?, preferred_method: :assert_includes
2427
+ # define_rule :assert, target_method: :instance_of?, inverse: true
2428
+ # @example Multiple target methods
2429
+ # # `preferred_method` is required
2430
+ # define_rule :assert, target_method: %i[match match? =~],
2431
+ # preferred_method: :assert_match, inverse: 'regexp_type?'
2432
+ # @param assertion_method [Symbol] Assertion method like `assert` or `refute`.
2433
+ # @param target_method [Symbol, Array<Symbol>] Method name(s) offensed by assertion method arguments.
2434
+ # @param preferred_method [Symbol] Is required if passing multiple target methods. Custom method name replaced by
2435
+ # autocorrection. The preferred method name that connects
2436
+ # `assertion_method` and `target_method` with `_` is
2437
+ # the default name.
2438
+ # @param inverse [Boolean, String] An optional param. Order of arguments replaced by autocorrection.
2439
+ # If string is passed, it becomes a predicate method for the first argument node.
2440
+ #
2441
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_cop_rule.rb#31
2442
+ def define_rule(assertion_method, target_method:, preferred_method: T.unsafe(nil), inverse: T.unsafe(nil)); end
2443
+ end
2444
+
2445
+ # Helper methods for different explorations against test files and test cases.
2446
+ #
2447
+ # @api private
2448
+ #
2449
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#9
2450
+ module RuboCop::Cop::MinitestExplorationHelpers
2451
+ include ::RuboCop::Cop::VisibilityHelp
2452
+ include ::RuboCop::Cop::DefNode
2453
+ extend ::RuboCop::AST::NodePattern::Macros
2454
+
2455
+ private
2456
+
2457
+ # @api private
2458
+ # @return [Boolean]
2459
+ #
2460
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#103
2461
+ def assertion_method?(node); end
2462
+
2463
+ # @api private
2464
+ #
2465
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#82
2466
+ def assertions(def_node); end
2467
+
2468
+ # @api private
2469
+ #
2470
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#96
2471
+ def assertions_count(node); end
2472
+
2473
+ # @api private
2474
+ #
2475
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#67
2476
+ def class_def_nodes(class_node); end
2477
+
2478
+ # @api private
2479
+ # @return [Boolean]
2480
+ #
2481
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#116
2482
+ def lifecycle_hook_method?(node); end
2483
+
2484
+ # @api private
2485
+ #
2486
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#62
2487
+ def lifecycle_hooks(class_node); end
2488
+
2489
+ # @api private
2490
+ # @return [Boolean]
2491
+ #
2492
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#58
2493
+ def test_block?(block_node); end
2494
+
2495
+ # @api private
2496
+ # @return [Boolean]
2497
+ #
2498
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#32
2499
+ def test_case?(node); end
2500
+
2501
+ # @api private
2502
+ # @return [Boolean]
2503
+ #
2504
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#78
2505
+ def test_case_name?(name); end
2506
+
2507
+ # @api private
2508
+ #
2509
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#40
2510
+ def test_cases(class_node, visibility_check: T.unsafe(nil)); end
2511
+
2512
+ # @api private
2513
+ # @return [Boolean]
2514
+ #
2515
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#28
2516
+ def test_class?(class_node); end
2517
+
2518
+ # @api private
2519
+ # @return [Boolean]
2520
+ #
2521
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#52
2522
+ def test_method?(def_node, visibility_check: T.unsafe(nil)); end
2523
+ end
2524
+
2525
+ # @api private
2526
+ #
2527
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#13
2528
+ RuboCop::Cop::MinitestExplorationHelpers::ASSERTION_PREFIXES = T.let(T.unsafe(nil), Array)
2529
+
2530
+ # @api private
2531
+ #
2532
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#24
2533
+ RuboCop::Cop::MinitestExplorationHelpers::LIFECYCLE_HOOK_METHODS = T.let(T.unsafe(nil), Set)
2534
+
2535
+ # @api private
2536
+ #
2537
+ # source://rubocop-minitest//lib/rubocop/cop/mixin/minitest_exploration_helpers.rb#15
2538
+ RuboCop::Cop::MinitestExplorationHelpers::LIFECYCLE_HOOK_METHODS_IN_ORDER = T.let(T.unsafe(nil), Array)
2539
+
2540
+ # RuboCop minitest project namespace
2541
+ #
2542
+ # source://rubocop-minitest//lib/rubocop/minitest.rb#5
2543
+ module RuboCop::Minitest; end
2544
+
2545
+ # source://rubocop-minitest//lib/rubocop/minitest.rb#8
2546
+ RuboCop::Minitest::CONFIG = T.let(T.unsafe(nil), Hash)
2547
+
2548
+ # source://rubocop-minitest//lib/rubocop/minitest.rb#7
2549
+ RuboCop::Minitest::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname)
2550
+
2551
+ # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
2552
+ # bit of our configuration.
2553
+ #
2554
+ # source://rubocop-minitest//lib/rubocop/minitest/inject.rb#7
2555
+ module RuboCop::Minitest::Inject
2556
+ class << self
2557
+ # source://rubocop-minitest//lib/rubocop/minitest/inject.rb#8
2558
+ def defaults!; end
2559
+ end
2560
+ end
2561
+
2562
+ # source://rubocop-minitest//lib/rubocop/minitest.rb#6
2563
+ RuboCop::Minitest::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname)
2564
+
2565
+ # This module holds the RuboCop Minitest version information.
2566
+ #
2567
+ # source://rubocop-minitest//lib/rubocop/minitest/version.rb#6
2568
+ module RuboCop::Minitest::Version
2569
+ class << self
2570
+ # source://rubocop-minitest//lib/rubocop/minitest/version.rb#9
2571
+ def document_version; end
2572
+ end
2573
+ end
2574
+
2575
+ # source://rubocop-minitest//lib/rubocop/minitest/version.rb#7
2576
+ RuboCop::Minitest::Version::STRING = T.let(T.unsafe(nil), String)