shopify-ruby-definitions 0.0.1 → 1.0.0

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