phlex-stimulus 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. checksums.yaml +7 -0
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +16 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +341 -0
  6. data/Rakefile +12 -0
  7. data/lib/generators/phlex/stimulus/controller/USAGE +5 -0
  8. data/lib/generators/phlex/stimulus/controller/controller_generator.rb +49 -0
  9. data/lib/generators/phlex/stimulus/controller/templates/component.rb.erb +30 -0
  10. data/lib/generators/phlex/stimulus/controller/templates/controller.ts.erb +23 -0
  11. data/lib/generators/phlex/stimulus/generator_mixin.rb +21 -0
  12. data/lib/generators/phlex/stimulus/install/USAGE +5 -0
  13. data/lib/generators/phlex/stimulus/install/install_generator.rb +111 -0
  14. data/lib/generators/phlex/stimulus/install/templates/app/components/base.rb.erb +29 -0
  15. data/lib/generators/phlex/stimulus/install/templates/app/components/chain_controller.rb.erb +29 -0
  16. data/lib/generators/phlex/stimulus/install/templates/app/components/classlist_controller.rb.erb +30 -0
  17. data/lib/generators/phlex/stimulus/install/templates/app/components/controller.rb.erb +10 -0
  18. data/lib/generators/phlex/stimulus/install/templates/app/components/controller_chain.rb.erb +32 -0
  19. data/lib/generators/phlex/stimulus/install/templates/app/components/controller_template.rb.erb +24 -0
  20. data/lib/generators/phlex/stimulus/install/templates/app/components/log_controller.rb.erb +33 -0
  21. data/lib/generators/phlex/stimulus/install/templates/app/components/sleep_controller.rb.erb +30 -0
  22. data/lib/generators/phlex/stimulus/install/templates/app/components.rb.erb +7 -0
  23. data/lib/generators/phlex/stimulus/install/templates/app/javascript/application.ts.erb +5 -0
  24. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/application.ts.erb +10 -0
  25. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/chain_controller.ts.erb +32 -0
  26. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/chainable_controller.ts.erb +44 -0
  27. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/classlist_controller.ts.erb +30 -0
  28. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/index.ts.erb +4 -0
  29. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/log_controller.ts.erb +25 -0
  30. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/sleep_controller.ts.erb +19 -0
  31. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/typed_controller.ts.erb +53 -0
  32. data/lib/generators/phlex/stimulus/install/templates/app/javascript/utils/misc.ts.erb +37 -0
  33. data/lib/generators/phlex/stimulus/install/templates/app/javascript/utils/template.ts.erb +11 -0
  34. data/lib/phlex/stimulus/components/base.rb +81 -0
  35. data/lib/phlex/stimulus/components/controller.rb +170 -0
  36. data/lib/phlex/stimulus/components.rb +9 -0
  37. data/lib/phlex/stimulus/version.rb +8 -0
  38. data/lib/phlex/stimulus.rb +15 -0
  39. data/sorbet/config +7 -0
  40. data/sorbet/rbi/annotations/.gitattributes +1 -0
  41. data/sorbet/rbi/annotations/actionmailer.rbi +15 -0
  42. data/sorbet/rbi/annotations/actionpack.rbi +430 -0
  43. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  44. data/sorbet/rbi/annotations/activejob.rbi +50 -0
  45. data/sorbet/rbi/annotations/activemodel.rbi +119 -0
  46. data/sorbet/rbi/annotations/activerecord.rbi +172 -0
  47. data/sorbet/rbi/annotations/activesupport.rbi +561 -0
  48. data/sorbet/rbi/annotations/globalid.rbi +30 -0
  49. data/sorbet/rbi/annotations/minitest.rbi +116 -0
  50. data/sorbet/rbi/annotations/railties.rbi +104 -0
  51. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  52. data/sorbet/rbi/dsl/.gitattributes +1 -0
  53. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  54. data/sorbet/rbi/gems/.gitattributes +1 -0
  55. data/sorbet/rbi/gems/action_text-trix@2.1.19.rbi +9 -0
  56. data/sorbet/rbi/gems/actioncable@8.1.3.rbi +9 -0
  57. data/sorbet/rbi/gems/actionmailbox@8.1.3.rbi +9 -0
  58. data/sorbet/rbi/gems/actionmailer@8.1.3.rbi +9 -0
  59. data/sorbet/rbi/gems/actionpack@8.1.3.rbi +20478 -0
  60. data/sorbet/rbi/gems/actiontext@8.1.3.rbi +9 -0
  61. data/sorbet/rbi/gems/actionview@8.1.3.rbi +14722 -0
  62. data/sorbet/rbi/gems/activejob@8.1.3.rbi +9 -0
  63. data/sorbet/rbi/gems/activemodel@8.1.3.rbi +9 -0
  64. data/sorbet/rbi/gems/activerecord@8.1.3.rbi +9 -0
  65. data/sorbet/rbi/gems/activestorage@8.1.3.rbi +9 -0
  66. data/sorbet/rbi/gems/activesupport@8.1.3.rbi +20153 -0
  67. data/sorbet/rbi/gems/ast@2.4.3.rbi +550 -0
  68. data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
  69. data/sorbet/rbi/gems/benchmark@0.5.0.rbi +621 -0
  70. data/sorbet/rbi/gems/booleans@0.1.3.rbi +31 -0
  71. data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
  72. data/sorbet/rbi/gems/byebug@12.0.0.rbi +49 -0
  73. data/sorbet/rbi/gems/concurrent-ruby@1.3.8.rbi +10656 -0
  74. data/sorbet/rbi/gems/connection_pool@3.0.2.rbi +9 -0
  75. data/sorbet/rbi/gems/crass@1.0.7.rbi +648 -0
  76. data/sorbet/rbi/gems/date@3.5.1.rbi +391 -0
  77. data/sorbet/rbi/gems/drb@2.2.3.rbi +9 -0
  78. data/sorbet/rbi/gems/erb@6.0.6.rbi +1600 -0
  79. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  80. data/sorbet/rbi/gems/globalid@1.4.0.rbi +9 -0
  81. data/sorbet/rbi/gems/i18n@1.15.2.rbi +2285 -0
  82. data/sorbet/rbi/gems/io-console@0.8.2.rbi +9 -0
  83. data/sorbet/rbi/gems/json@2.21.1.rbi +2289 -0
  84. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
  85. data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
  86. data/sorbet/rbi/gems/loofah@2.25.2.rbi +1134 -0
  87. data/sorbet/rbi/gems/mail@2.9.1.rbi +9 -0
  88. data/sorbet/rbi/gems/marcel@1.2.1.rbi +9 -0
  89. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +9 -0
  90. data/sorbet/rbi/gems/minitest@6.0.6.rbi +1482 -0
  91. data/sorbet/rbi/gems/net-imap@0.6.4.1.rbi +9 -0
  92. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +9 -0
  93. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +244 -0
  94. data/sorbet/rbi/gems/net-smtp@0.5.1.rbi +9 -0
  95. data/sorbet/rbi/gems/netrc@0.11.0.rbi +147 -0
  96. data/sorbet/rbi/gems/nio4r@2.7.5.rbi +9 -0
  97. data/sorbet/rbi/gems/nokogiri@1.19.4.rbi +8168 -0
  98. data/sorbet/rbi/gems/parallel@1.28.0.rbi +270 -0
  99. data/sorbet/rbi/gems/phlex-rails@2.4.0.rbi +1945 -0
  100. data/sorbet/rbi/gems/phlex@2.4.1.rbi +1413 -0
  101. data/sorbet/rbi/gems/pp@0.6.4.rbi +387 -0
  102. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +455 -0
  103. data/sorbet/rbi/gems/prism@1.9.0.rbi +42226 -0
  104. data/sorbet/rbi/gems/racc@1.8.1.rbi +165 -0
  105. data/sorbet/rbi/gems/rack-session@2.1.2.rbi +756 -0
  106. data/sorbet/rbi/gems/rack-test@2.2.0.rbi +681 -0
  107. data/sorbet/rbi/gems/rack@3.2.6.rbi +4653 -0
  108. data/sorbet/rbi/gems/rackup@2.3.1.rbi +9 -0
  109. data/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi +517 -0
  110. data/sorbet/rbi/gems/rails-html-sanitizer@1.7.1.rbi +620 -0
  111. data/sorbet/rbi/gems/rails@8.1.3.rbi +9 -0
  112. data/sorbet/rbi/gems/railties@8.1.3.rbi +3507 -0
  113. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +362 -0
  114. data/sorbet/rbi/gems/rake@13.4.2.rbi +3130 -0
  115. data/sorbet/rbi/gems/rbi@0.4.0.rbi +5706 -0
  116. data/sorbet/rbi/gems/rbs@4.0.3.rbi +6908 -0
  117. data/sorbet/rbi/gems/refract@1.1.0.rbi +9 -0
  118. data/sorbet/rbi/gems/reline@0.6.3.rbi +2446 -0
  119. data/sorbet/rbi/gems/require-hooks@0.4.0.rbi +152 -0
  120. data/sorbet/rbi/gems/rexml@3.4.4.rbi +4905 -0
  121. data/sorbet/rbi/gems/rubocop-espago@1.3.0.rbi +9 -0
  122. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
  123. data/sorbet/rbi/gems/rubydex@0.2.9.rbi +841 -0
  124. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  125. data/sorbet/rbi/gems/shoulda-context@2.0.0.rbi +544 -0
  126. data/sorbet/rbi/gems/spoom@1.8.4.rbi +6738 -0
  127. data/sorbet/rbi/gems/tapioca@0.19.2.rbi +3599 -0
  128. data/sorbet/rbi/gems/thor@1.5.0.rbi +3870 -0
  129. data/sorbet/rbi/gems/timeout@0.6.1.rbi +200 -0
  130. data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
  131. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5474 -0
  132. data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +130 -0
  133. data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +332 -0
  134. data/sorbet/rbi/gems/uri@1.1.1.rbi +2402 -0
  135. data/sorbet/rbi/gems/useragent@0.16.11.rbi +9 -0
  136. data/sorbet/rbi/gems/websocket-driver@0.8.2.rbi +9 -0
  137. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +9 -0
  138. data/sorbet/rbi/gems/zeitwerk@2.8.2.rbi +9 -0
  139. data/sorbet/rbi/shims/gems/parser.rbi +12 -0
  140. data/sorbet/rbi/shims/gems/rails.rbi +55 -0
  141. data/sorbet/rbi/shims/gems/refract.rbi +13 -0
  142. data/sorbet/rbi/shims/gems/shoulda-context.rbi +16 -0
  143. data/sorbet/tapioca/compilers/phlex_controller.rb +80 -0
  144. data/sorbet/tapioca/config.yml +26 -0
  145. data/sorbet/tapioca/extensions/load_gem.rb +1 -0
  146. data/sorbet/tapioca/require.rb +4 -0
  147. metadata +266 -0
@@ -0,0 +1,1482 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `minitest` gem.
5
+ # Please instead update this file by running `bin/tapioca gem minitest`.
6
+
7
+
8
+ # The top-level namespace for Minitest. Also the location of the main
9
+ # runtime. See +Minitest.run+ for more information.
10
+ # this is gonna break some shit?
11
+ # for ruby 3
12
+ # :stopdoc:
13
+ # :stopdoc:
14
+ # :startdoc:
15
+ #
16
+ # pkg:gem/minitest#lib/minitest/parallel.rb:3
17
+ module Minitest
18
+ class << self
19
+ # A simple hook allowing you to run a block of code after everything
20
+ # is done running. Eg:
21
+ #
22
+ # Minitest.after_run { p $debugging_info }
23
+ #
24
+ # pkg:gem/minitest#lib/minitest.rb:95
25
+ def after_run(&block); end
26
+
27
+ # pkg:gem/minitest#lib/minitest.rb:20
28
+ def allow_fork; end
29
+
30
+ # pkg:gem/minitest#lib/minitest.rb:20
31
+ def allow_fork=(_arg0); end
32
+
33
+ # Registers Minitest to run at process exit
34
+ #
35
+ # pkg:gem/minitest#lib/minitest.rb:69
36
+ def autorun; end
37
+
38
+ # pkg:gem/minitest#lib/minitest.rb:20
39
+ def backtrace_filter; end
40
+
41
+ # pkg:gem/minitest#lib/minitest.rb:20
42
+ def backtrace_filter=(_arg0); end
43
+
44
+ # pkg:gem/minitest#lib/minitest.rb:19
45
+ def cattr_accessor(name); end
46
+
47
+ # pkg:gem/minitest#lib/minitest.rb:1209
48
+ def clock_time; end
49
+
50
+ # pkg:gem/minitest#lib/minitest.rb:332
51
+ def empty_run!(options); end
52
+
53
+ # pkg:gem/minitest#lib/minitest.rb:20
54
+ def extensions; end
55
+
56
+ # pkg:gem/minitest#lib/minitest.rb:20
57
+ def extensions=(_arg0); end
58
+
59
+ # pkg:gem/minitest#lib/minitest.rb:365
60
+ def filter_backtrace(bt); end
61
+
62
+ # pkg:gem/minitest#lib/minitest.rb:20
63
+ def info_signal; end
64
+
65
+ # pkg:gem/minitest#lib/minitest.rb:20
66
+ def info_signal=(_arg0); end
67
+
68
+ # pkg:gem/minitest#lib/minitest.rb:134
69
+ def init_plugins(options); end
70
+
71
+ # Manually load plugins by name.
72
+ #
73
+ # pkg:gem/minitest#lib/minitest.rb:102
74
+ def load(*names); end
75
+
76
+ # pkg:gem/minitest#lib/minitest.rb:118
77
+ def load_plugins; end
78
+
79
+ # pkg:gem/minitest#lib/minitest.rb:20
80
+ def parallel_executor; end
81
+
82
+ # pkg:gem/minitest#lib/minitest.rb:20
83
+ def parallel_executor=(_arg0); end
84
+
85
+ # pkg:gem/minitest#lib/minitest.rb:152
86
+ def process_args(args = T.unsafe(nil)); end
87
+
88
+ # Register a plugin to be used. Does NOT require / load it.
89
+ #
90
+ # pkg:gem/minitest#lib/minitest.rb:113
91
+ def register_plugin(name_or_mod); end
92
+
93
+ # pkg:gem/minitest#lib/minitest.rb:20
94
+ def reporter; end
95
+
96
+ # pkg:gem/minitest#lib/minitest.rb:20
97
+ def reporter=(_arg0); end
98
+
99
+ # This is the top-level run method. Everything starts from here. It
100
+ # tells each Runnable sub-class to run, and each of those are
101
+ # responsible for doing whatever they do.
102
+ #
103
+ # The overall structure of a run looks like this:
104
+ #
105
+ # [Minitest.load_plugins] optional, called by user, or require what you want
106
+ # Minitest.autorun
107
+ # Minitest.run(args)
108
+ # Minitest.process_args
109
+ # Minitest.init_plugins
110
+ # Minitest.run_all_suites(reporter, options)
111
+ # Runnable.runnables.each |runnable_klass|
112
+ # runnable_klass.run_suite(reporter, options)
113
+ # filtered_methods = runnable_klass.filter_runnable_methods options
114
+ # filtered_methods.each |runnable_method|
115
+ # runnable_klass.run(self, runnable_method, reporter)
116
+ # runnable_klass.new(runnable_method).run
117
+ #
118
+ # pkg:gem/minitest#lib/minitest.rb:299
119
+ def run(args = T.unsafe(nil)); end
120
+
121
+ # Internal run method. Responsible for telling all Runnable
122
+ # sub-classes to run.
123
+ #
124
+ # pkg:gem/minitest#lib/minitest.rb:352
125
+ def run_all_suites(reporter, options); end
126
+
127
+ # pkg:gem/minitest#lib/minitest.rb:20
128
+ def seed; end
129
+
130
+ # pkg:gem/minitest#lib/minitest.rb:20
131
+ def seed=(_arg0); end
132
+ end
133
+ end
134
+
135
+ # Defines the API for Reporters. Subclass this and override whatever
136
+ # you want. Go nuts.
137
+ #
138
+ # pkg:gem/minitest#lib/minitest.rb:707
139
+ class Minitest::AbstractReporter
140
+ # pkg:gem/minitest#lib/minitest.rb:709
141
+ def initialize; end
142
+
143
+ # Did this run pass?
144
+ #
145
+ # pkg:gem/minitest#lib/minitest.rb:744
146
+ def passed?; end
147
+
148
+ # About to start running a test. This allows a reporter to show
149
+ # that it is starting or that we are in the middle of a test run.
150
+ #
151
+ # pkg:gem/minitest#lib/minitest.rb:723
152
+ def prerecord(klass, name); end
153
+
154
+ # Output and record the result of the test. Call
155
+ # {result#result_code}[rdoc-ref:Runnable#result_code] to get the
156
+ # result character string. Stores the result of the run if the run
157
+ # did not pass.
158
+ #
159
+ # pkg:gem/minitest#lib/minitest.rb:732
160
+ def record(result); end
161
+
162
+ # Outputs the summary of the run.
163
+ #
164
+ # pkg:gem/minitest#lib/minitest.rb:738
165
+ def report; end
166
+
167
+ # Starts reporting on the run.
168
+ #
169
+ # pkg:gem/minitest#lib/minitest.rb:716
170
+ def start; end
171
+
172
+ # pkg:gem/minitest#lib/minitest.rb:748
173
+ def synchronize(&block); end
174
+ end
175
+
176
+ # Represents run failures.
177
+ #
178
+ # pkg:gem/minitest#lib/minitest.rb:1039
179
+ class Minitest::Assertion < ::Exception
180
+ # pkg:gem/minitest#lib/minitest.rb:1042
181
+ def error; end
182
+
183
+ # Where was this run before an assertion was raised?
184
+ #
185
+ # pkg:gem/minitest#lib/minitest.rb:1049
186
+ def location; end
187
+
188
+ # pkg:gem/minitest#lib/minitest.rb:1057
189
+ def result_code; end
190
+
191
+ # pkg:gem/minitest#lib/minitest.rb:1061
192
+ def result_label; end
193
+ end
194
+
195
+ # pkg:gem/minitest#lib/minitest.rb:1040
196
+ Minitest::Assertion::RE = T.let(T.unsafe(nil), Regexp)
197
+
198
+ # Minitest Assertions. All assertion methods accept a +msg+ which is
199
+ # printed if the assertion fails.
200
+ #
201
+ # Protocol: Nearly everything here boils up to +assert+, which
202
+ # expects to be able to increment an instance accessor named
203
+ # +assertions+. This is not provided by Assertions and must be
204
+ # provided by the thing including Assertions. See Minitest::Runnable
205
+ # for an example.
206
+ #
207
+ # pkg:gem/minitest#lib/minitest/assertions.rb:16
208
+ module Minitest::Assertions
209
+ # pkg:gem/minitest#lib/minitest/assertions.rb:181
210
+ def _synchronize; end
211
+
212
+ # Fails unless +test+ is truthy.
213
+ #
214
+ # pkg:gem/minitest#lib/minitest/assertions.rb:171
215
+ def assert(test, msg = T.unsafe(nil)); end
216
+
217
+ # Fails unless +obj+ is empty.
218
+ #
219
+ # pkg:gem/minitest#lib/minitest/assertions.rb:188
220
+ def assert_empty(obj, msg = T.unsafe(nil)); end
221
+
222
+ # Fails unless <tt>exp == act</tt> printing the difference between
223
+ # the two, if possible.
224
+ #
225
+ # If there is no visible difference but the assertion fails, you
226
+ # should suspect that your #== is buggy, or your inspect output is
227
+ # missing crucial details. For nicer structural diffing, set
228
+ # Minitest::Test.make_my_diffs_pretty!
229
+ #
230
+ # For floats use assert_in_delta.
231
+ #
232
+ # See also: Minitest::Assertions.diff
233
+ #
234
+ # pkg:gem/minitest#lib/minitest/assertions.rb:206
235
+ def assert_equal(exp, act, msg = T.unsafe(nil)); end
236
+
237
+ # For comparing Floats. Fails unless +exp+ and +act+ are within +delta+
238
+ # of each other.
239
+ #
240
+ # assert_in_delta Math::PI, (22.0 / 7.0), 0.01
241
+ #
242
+ # pkg:gem/minitest#lib/minitest/assertions.rb:220
243
+ def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end
244
+
245
+ # For comparing Floats. Fails unless +exp+ and +act+ have a relative
246
+ # error less than +epsilon+.
247
+ #
248
+ # pkg:gem/minitest#lib/minitest/assertions.rb:232
249
+ def assert_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end
250
+
251
+ # Fails unless +collection+ includes +obj+.
252
+ #
253
+ # pkg:gem/minitest#lib/minitest/assertions.rb:239
254
+ def assert_includes(collection, obj, msg = T.unsafe(nil)); end
255
+
256
+ # Fails unless +obj+ is an instance of +cls+.
257
+ #
258
+ # pkg:gem/minitest#lib/minitest/assertions.rb:249
259
+ def assert_instance_of(cls, obj, msg = T.unsafe(nil)); end
260
+
261
+ # Fails unless +obj+ is a kind of +cls+.
262
+ #
263
+ # pkg:gem/minitest#lib/minitest/assertions.rb:260
264
+ def assert_kind_of(cls, obj, msg = T.unsafe(nil)); end
265
+
266
+ # Fails unless +matcher+ <tt>=~</tt> +obj+.
267
+ #
268
+ # pkg:gem/minitest#lib/minitest/assertions.rb:271
269
+ def assert_match(matcher, obj, msg = T.unsafe(nil)); end
270
+
271
+ # Fails unless +obj+ is nil
272
+ #
273
+ # pkg:gem/minitest#lib/minitest/assertions.rb:283
274
+ def assert_nil(obj, msg = T.unsafe(nil)); end
275
+
276
+ # For testing with binary operators. Eg:
277
+ #
278
+ # assert_operator 5, :<=, 4
279
+ #
280
+ # pkg:gem/minitest#lib/minitest/assertions.rb:293
281
+ def assert_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end
282
+
283
+ # Fails if stdout or stderr do not output the expected results.
284
+ # Pass in nil if you don't care about that streams output. Pass in
285
+ # "" if you require it to be silent. Pass in a regexp if you want
286
+ # to pattern match.
287
+ #
288
+ # assert_output(/hey/) { method_with_output }
289
+ #
290
+ # NOTE: this uses #capture_io, not #capture_subprocess_io.
291
+ #
292
+ # See also: #assert_silent
293
+ #
294
+ # pkg:gem/minitest#lib/minitest/assertions.rb:312
295
+ def assert_output(stdout = T.unsafe(nil), stderr = T.unsafe(nil)); end
296
+
297
+ # Fails unless +path+ exists.
298
+ #
299
+ # pkg:gem/minitest#lib/minitest/assertions.rb:336
300
+ def assert_path_exists(path, msg = T.unsafe(nil)); end
301
+
302
+ # For testing with pattern matching (only supported with Ruby 3.0 and later)
303
+ #
304
+ # # pass
305
+ # assert_pattern { [1,2,3] => [Integer, Integer, Integer] }
306
+ #
307
+ # # fail "length mismatch (given 3, expected 1)"
308
+ # assert_pattern { [1,2,3] => [Integer] }
309
+ #
310
+ # The bare <tt>=></tt> pattern will raise a NoMatchingPatternError on failure, which would
311
+ # normally be counted as a test error. This assertion rescues NoMatchingPatternError and
312
+ # generates a test failure. Any other exception will be raised as normal and generate a test
313
+ # error.
314
+ #
315
+ # pkg:gem/minitest#lib/minitest/assertions.rb:355
316
+ def assert_pattern; end
317
+
318
+ # For testing with predicates. Eg:
319
+ #
320
+ # assert_predicate str, :empty?
321
+ #
322
+ # This is really meant for specs and is front-ended by assert_operator:
323
+ #
324
+ # str.must_be :empty?
325
+ #
326
+ # pkg:gem/minitest#lib/minitest/assertions.rb:373
327
+ def assert_predicate(o1, op, msg = T.unsafe(nil)); end
328
+
329
+ # Fails unless the block raises one of +exp+. Returns the
330
+ # exception matched so you can check the message, attributes, etc.
331
+ #
332
+ # +exp+ takes an optional message on the end to help explain
333
+ # failures and defaults to StandardError if no exception class is
334
+ # passed. Eg:
335
+ #
336
+ # assert_raises(CustomError) { method_with_custom_error }
337
+ #
338
+ # With custom error message:
339
+ #
340
+ # assert_raises(CustomError, 'This should have raised CustomError') { method_with_custom_error }
341
+ #
342
+ # Using the returned object:
343
+ #
344
+ # error = assert_raises(CustomError) do
345
+ # raise CustomError, 'This is really bad'
346
+ # end
347
+ #
348
+ # assert_equal 'This is really bad', error.message
349
+ #
350
+ # pkg:gem/minitest#lib/minitest/assertions.rb:403
351
+ def assert_raises(*exp); end
352
+
353
+ # Fails unless +obj+ responds to +meth+.
354
+ # include_all defaults to false to match Object#respond_to?
355
+ #
356
+ # pkg:gem/minitest#lib/minitest/assertions.rb:438
357
+ def assert_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end
358
+
359
+ # Fails unless +exp+ and +act+ are #equal?
360
+ #
361
+ # pkg:gem/minitest#lib/minitest/assertions.rb:446
362
+ def assert_same(exp, act, msg = T.unsafe(nil)); end
363
+
364
+ # Fails if the block outputs anything to stderr or stdout.
365
+ #
366
+ # See also: #assert_output
367
+ #
368
+ # pkg:gem/minitest#lib/minitest/assertions.rb:462
369
+ def assert_silent; end
370
+
371
+ # Fails unless the block throws +sym+
372
+ #
373
+ # pkg:gem/minitest#lib/minitest/assertions.rb:471
374
+ def assert_throws(sym, msg = T.unsafe(nil)); end
375
+
376
+ # Captures $stdout and $stderr into strings:
377
+ #
378
+ # out, err = capture_io do
379
+ # puts "Some info"
380
+ # warn "You did a bad thing"
381
+ # end
382
+ #
383
+ # assert_match %r%info%, out
384
+ # assert_match %r%bad%, err
385
+ #
386
+ # NOTE: For efficiency, this method uses StringIO and does not
387
+ # capture IO for subprocesses. Use #capture_subprocess_io for
388
+ # that.
389
+ #
390
+ # pkg:gem/minitest#lib/minitest/assertions.rb:507
391
+ def capture_io; end
392
+
393
+ # Captures $stdout and $stderr into strings, using Tempfile to
394
+ # ensure that subprocess IO is captured as well.
395
+ #
396
+ # out, err = capture_subprocess_io do
397
+ # system "echo Some info"
398
+ # system "echo You did a bad thing 1>&2"
399
+ # end
400
+ #
401
+ # assert_match %r%info%, out
402
+ # assert_match %r%bad%, err
403
+ #
404
+ # NOTE: This method is approximately 10x slower than #capture_io so
405
+ # only use it when you need to test the output of a subprocess.
406
+ #
407
+ # pkg:gem/minitest#lib/minitest/assertions.rb:540
408
+ def capture_subprocess_io; end
409
+
410
+ # Returns a diff between +exp+ and +act+. If there is no known
411
+ # diff command or if it doesn't make sense to diff the output
412
+ # (single line, short output), then it simply returns a basic
413
+ # comparison between the two.
414
+ #
415
+ # See +things_to_diff+ for more info.
416
+ #
417
+ # pkg:gem/minitest#lib/minitest/assertions.rb:57
418
+ def diff(exp, act); end
419
+
420
+ # Returns details for exception +e+
421
+ #
422
+ # pkg:gem/minitest#lib/minitest/assertions.rb:572
423
+ def exception_details(e, msg); end
424
+
425
+ # Fails after a given date (in the local time zone). This allows
426
+ # you to put time-bombs in your tests if you need to keep
427
+ # something around until a later date lest you forget about it.
428
+ #
429
+ # pkg:gem/minitest#lib/minitest/assertions.rb:588
430
+ def fail_after(y, m, d, msg); end
431
+
432
+ # Fails with +msg+.
433
+ #
434
+ # pkg:gem/minitest#lib/minitest/assertions.rb:595
435
+ def flunk(msg = T.unsafe(nil)); end
436
+
437
+ # Returns a proc that delays generation of an output message. If
438
+ # +msg+ is a proc (eg, from another +message+ call) return +msg+
439
+ # as-is. Otherwise, return a proc that will output +msg+ along
440
+ # with the value of the result of the block passed to +message+.
441
+ #
442
+ # pkg:gem/minitest#lib/minitest/assertions.rb:606
443
+ def message(msg = T.unsafe(nil), ending = T.unsafe(nil), &default); end
444
+
445
+ # This returns a human-readable version of +obj+. By default
446
+ # #inspect is called. You can override this to use #pretty_inspect
447
+ # if you want.
448
+ #
449
+ # See Minitest::Test.make_my_diffs_pretty!
450
+ #
451
+ # pkg:gem/minitest#lib/minitest/assertions.rb:127
452
+ def mu_pp(obj); end
453
+
454
+ # This returns a diff-able more human-readable version of +obj+.
455
+ # This differs from the regular mu_pp because it expands escaped
456
+ # newlines and makes hex-values (like object_ids) generic. This
457
+ # uses mu_pp to do the first pass and then cleans it up.
458
+ #
459
+ # pkg:gem/minitest#lib/minitest/assertions.rb:145
460
+ def mu_pp_for_diff(obj); end
461
+
462
+ # used for counting assertions
463
+ #
464
+ # pkg:gem/minitest#lib/minitest/assertions.rb:617
465
+ def pass(_msg = T.unsafe(nil)); end
466
+
467
+ # Fails if +test+ is truthy.
468
+ #
469
+ # pkg:gem/minitest#lib/minitest/assertions.rb:624
470
+ def refute(test, msg = T.unsafe(nil)); end
471
+
472
+ # Fails if +obj+ is empty.
473
+ #
474
+ # pkg:gem/minitest#lib/minitest/assertions.rb:632
475
+ def refute_empty(obj, msg = T.unsafe(nil)); end
476
+
477
+ # Fails if <tt>exp == act</tt>.
478
+ #
479
+ # For floats use refute_in_delta.
480
+ #
481
+ # pkg:gem/minitest#lib/minitest/assertions.rb:642
482
+ def refute_equal(exp, act, msg = T.unsafe(nil)); end
483
+
484
+ # For comparing Floats. Fails if +exp+ is within +delta+ of +act+.
485
+ #
486
+ # refute_in_delta Math::PI, (22.0 / 7.0)
487
+ #
488
+ # pkg:gem/minitest#lib/minitest/assertions.rb:654
489
+ def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end
490
+
491
+ # For comparing Floats. Fails if +exp+ and +act+ have a relative error
492
+ # less than +epsilon+.
493
+ #
494
+ # pkg:gem/minitest#lib/minitest/assertions.rb:666
495
+ def refute_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end
496
+
497
+ # Fails if +obj+ includes +sub+.
498
+ #
499
+ # pkg:gem/minitest#lib/minitest/assertions.rb:673
500
+ def refute_includes(obj, sub, msg = T.unsafe(nil)); end
501
+
502
+ # Fails if +obj+ is an instance of +cls+.
503
+ #
504
+ # pkg:gem/minitest#lib/minitest/assertions.rb:681
505
+ def refute_instance_of(cls, obj, msg = T.unsafe(nil)); end
506
+
507
+ # Fails if +obj+ is a kind of +cls+.
508
+ #
509
+ # pkg:gem/minitest#lib/minitest/assertions.rb:691
510
+ def refute_kind_of(cls, obj, msg = T.unsafe(nil)); end
511
+
512
+ # Fails if +matcher+ <tt>=~</tt> +obj+.
513
+ #
514
+ # pkg:gem/minitest#lib/minitest/assertions.rb:699
515
+ def refute_match(matcher, obj, msg = T.unsafe(nil)); end
516
+
517
+ # Fails if +obj+ is nil.
518
+ #
519
+ # pkg:gem/minitest#lib/minitest/assertions.rb:708
520
+ def refute_nil(obj, msg = T.unsafe(nil)); end
521
+
522
+ # Fails if +o1+ is not +op+ +o2+. Eg:
523
+ #
524
+ # refute_operator 1, :>, 2 #=> pass
525
+ # refute_operator 1, :<, 2 #=> fail
526
+ #
527
+ # pkg:gem/minitest#lib/minitest/assertions.rb:740
528
+ def refute_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end
529
+
530
+ # Fails if +path+ exists.
531
+ #
532
+ # pkg:gem/minitest#lib/minitest/assertions.rb:750
533
+ def refute_path_exists(path, msg = T.unsafe(nil)); end
534
+
535
+ # For testing with pattern matching (only supported with Ruby 3.0 and later)
536
+ #
537
+ # # pass
538
+ # refute_pattern { [1,2,3] => [String] }
539
+ #
540
+ # # fail "NoMatchingPatternError expected, but nothing was raised."
541
+ # refute_pattern { [1,2,3] => [Integer, Integer, Integer] }
542
+ #
543
+ # This assertion expects a NoMatchingPatternError exception, and will fail if none is raised. Any
544
+ # other exceptions will be raised as normal and generate a test error.
545
+ #
546
+ # pkg:gem/minitest#lib/minitest/assertions.rb:725
547
+ def refute_pattern; end
548
+
549
+ # For testing with predicates.
550
+ #
551
+ # refute_predicate str, :empty?
552
+ #
553
+ # This is really meant for specs and is front-ended by refute_operator:
554
+ #
555
+ # str.wont_be :empty?
556
+ #
557
+ # pkg:gem/minitest#lib/minitest/assertions.rb:764
558
+ def refute_predicate(o1, op, msg = T.unsafe(nil)); end
559
+
560
+ # Fails if +obj+ responds to the message +meth+.
561
+ # include_all defaults to false to match Object#respond_to?
562
+ #
563
+ # pkg:gem/minitest#lib/minitest/assertions.rb:774
564
+ def refute_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end
565
+
566
+ # Fails if +exp+ is the same (by object identity) as +act+.
567
+ #
568
+ # pkg:gem/minitest#lib/minitest/assertions.rb:783
569
+ def refute_same(exp, act, msg = T.unsafe(nil)); end
570
+
571
+ # Skips the current run. If run in verbose-mode, the skipped run
572
+ # gets listed at the end of the run but doesn't cause a failure
573
+ # exit code.
574
+ #
575
+ # pkg:gem/minitest#lib/minitest/assertions.rb:796
576
+ def skip(msg = T.unsafe(nil), _ignored = T.unsafe(nil)); end
577
+
578
+ # Skips the current run until a given date (in the local time
579
+ # zone). This allows you to put some fixes on hold until a later
580
+ # date, but still holds you accountable and prevents you from
581
+ # forgetting it.
582
+ #
583
+ # pkg:gem/minitest#lib/minitest/assertions.rb:808
584
+ def skip_until(y, m, d, msg); end
585
+
586
+ # Was this testcase skipped? Meant for #teardown.
587
+ #
588
+ # pkg:gem/minitest#lib/minitest/assertions.rb:817
589
+ def skipped?; end
590
+
591
+ # Returns things to diff [expect, butwas], or [nil, nil] if nothing to diff.
592
+ #
593
+ # Criterion:
594
+ #
595
+ # 1. Strings include newlines or escaped newlines, but not both.
596
+ # 2. or: String lengths are > 30 characters.
597
+ # 3. or: Strings are equal to each other (but maybe different encodings?).
598
+ # 4. and: we found a diff executable.
599
+ #
600
+ # pkg:gem/minitest#lib/minitest/assertions.rb:102
601
+ def things_to_diff(exp, act); end
602
+
603
+ class << self
604
+ # Returns the diff command to use in #diff. Tries to intelligently
605
+ # figure out what diff to use.
606
+ #
607
+ # pkg:gem/minitest#lib/minitest/assertions.rb:27
608
+ def diff; end
609
+
610
+ # Set the diff command to use in #diff.
611
+ #
612
+ # pkg:gem/minitest#lib/minitest/assertions.rb:45
613
+ def diff=(o); end
614
+ end
615
+ end
616
+
617
+ # pkg:gem/minitest#lib/minitest/assertions.rb:379
618
+ Minitest::Assertions::NO_RE_MSG = T.let(T.unsafe(nil), String)
619
+
620
+ # pkg:gem/minitest#lib/minitest/assertions.rb:17
621
+ Minitest::Assertions::UNDEFINED = T.let(T.unsafe(nil), Object)
622
+
623
+ # The standard backtrace filter for minitest.
624
+ #
625
+ # See Minitest.backtrace_filter=.
626
+ #
627
+ # pkg:gem/minitest#lib/minitest.rb:1174
628
+ class Minitest::BacktraceFilter
629
+ # pkg:gem/minitest#lib/minitest.rb:1183
630
+ def initialize(regexp = T.unsafe(nil)); end
631
+
632
+ # Filter +bt+ to something useful. Returns the whole thing if
633
+ # $DEBUG (ruby) or $MT_DEBUG (env).
634
+ #
635
+ # pkg:gem/minitest#lib/minitest.rb:1191
636
+ def filter(bt); end
637
+
638
+ # The regular expression to use to filter backtraces. Defaults to +MT_RE+.
639
+ #
640
+ # pkg:gem/minitest#lib/minitest.rb:1181
641
+ def regexp; end
642
+
643
+ # The regular expression to use to filter backtraces. Defaults to +MT_RE+.
644
+ #
645
+ # pkg:gem/minitest#lib/minitest.rb:1181
646
+ def regexp=(_arg0); end
647
+ end
648
+
649
+ # pkg:gem/minitest#lib/minitest.rb:1176
650
+ Minitest::BacktraceFilter::MT_RE = T.let(T.unsafe(nil), Regexp)
651
+
652
+ # Dispatch to multiple reporters as one.
653
+ #
654
+ # pkg:gem/minitest#lib/minitest.rb:989
655
+ class Minitest::CompositeReporter < ::Minitest::AbstractReporter
656
+ # pkg:gem/minitest#lib/minitest.rb:995
657
+ def initialize(*reporters); end
658
+
659
+ # Add another reporter to the mix.
660
+ #
661
+ # pkg:gem/minitest#lib/minitest.rb:1007
662
+ def <<(reporter); end
663
+
664
+ # pkg:gem/minitest#lib/minitest.rb:1000
665
+ def io; end
666
+
667
+ # pkg:gem/minitest#lib/minitest.rb:1011
668
+ def passed?; end
669
+
670
+ # pkg:gem/minitest#lib/minitest.rb:1019
671
+ def prerecord(klass, name); end
672
+
673
+ # pkg:gem/minitest#lib/minitest.rb:1025
674
+ def record(result); end
675
+
676
+ # pkg:gem/minitest#lib/minitest.rb:1031
677
+ def report; end
678
+
679
+ # The list of reporters to dispatch to.
680
+ #
681
+ # pkg:gem/minitest#lib/minitest.rb:993
682
+ def reporters; end
683
+
684
+ # The list of reporters to dispatch to.
685
+ #
686
+ # pkg:gem/minitest#lib/minitest.rb:993
687
+ def reporters=(_arg0); end
688
+
689
+ # pkg:gem/minitest#lib/minitest.rb:1015
690
+ def start; end
691
+ end
692
+
693
+ # Compresses backtraces.
694
+ #
695
+ # pkg:gem/minitest#lib/minitest/compress.rb:5
696
+ module Minitest::Compress
697
+ # Takes a backtrace (array of strings) and compresses repeating
698
+ # cycles in it to make it more readable.
699
+ #
700
+ # pkg:gem/minitest#lib/minitest/compress.rb:11
701
+ def compress(orig); end
702
+ end
703
+
704
+ # Provides a simple set of guards that you can use in your tests
705
+ # to skip execution if it is not applicable. These methods are
706
+ # mixed into Test as both instance and class methods so you
707
+ # can use them inside or outside of the test methods.
708
+ #
709
+ # def test_something_for_mri
710
+ # skip "bug 1234" if jruby?
711
+ # # ...
712
+ # end
713
+ #
714
+ # if windows? then
715
+ # # ... lots of test methods ...
716
+ # end
717
+ #
718
+ # pkg:gem/minitest#lib/minitest.rb:1138
719
+ module Minitest::Guard
720
+ # Is this running on jruby?
721
+ #
722
+ # pkg:gem/minitest#lib/minitest.rb:1143
723
+ def jruby?(platform = T.unsafe(nil)); end
724
+
725
+ # Is this running on mri?
726
+ #
727
+ # pkg:gem/minitest#lib/minitest.rb:1150
728
+ def mri?(platform = T.unsafe(nil)); end
729
+
730
+ # Is this running on macOS?
731
+ #
732
+ # pkg:gem/minitest#lib/minitest.rb:1157
733
+ def osx?(platform = T.unsafe(nil)); end
734
+
735
+ # Is this running on windows?
736
+ #
737
+ # pkg:gem/minitest#lib/minitest.rb:1164
738
+ def windows?(platform = T.unsafe(nil)); end
739
+ end
740
+
741
+ # pkg:gem/minitest#lib/minitest/parallel.rb:4
742
+ module Minitest::Parallel; end
743
+
744
+ # The engine used to run multiple tests in parallel.
745
+ #
746
+ # pkg:gem/minitest#lib/minitest/parallel.rb:9
747
+ class Minitest::Parallel::Executor
748
+ # Create a parallel test executor of with +size+ workers.
749
+ #
750
+ # pkg:gem/minitest#lib/minitest/parallel.rb:19
751
+ def initialize(size); end
752
+
753
+ # Add a job to the queue
754
+ #
755
+ # pkg:gem/minitest#lib/minitest/parallel.rb:45
756
+ def <<(work); end
757
+
758
+ # Shuts down the pool of workers by signalling them to quit and
759
+ # waiting for them all to finish what they're currently working
760
+ # on.
761
+ #
762
+ # pkg:gem/minitest#lib/minitest/parallel.rb:52
763
+ def shutdown; end
764
+
765
+ # The size of the pool of workers.
766
+ #
767
+ # pkg:gem/minitest#lib/minitest/parallel.rb:14
768
+ def size; end
769
+
770
+ # Start the executor
771
+ #
772
+ # pkg:gem/minitest#lib/minitest/parallel.rb:28
773
+ def start; end
774
+ end
775
+
776
+ # pkg:gem/minitest#lib/minitest/parallel.rb:58
777
+ module Minitest::Parallel::Test
778
+ # pkg:gem/minitest#lib/minitest/parallel.rb:59
779
+ def _synchronize; end
780
+ end
781
+
782
+ # pkg:gem/minitest#lib/minitest/parallel.rb:61
783
+ module Minitest::Parallel::Test::ClassMethods
784
+ # pkg:gem/minitest#lib/minitest/parallel.rb:62
785
+ def run(klass, method_name, reporter); end
786
+
787
+ # pkg:gem/minitest#lib/minitest/parallel.rb:66
788
+ def run_order; end
789
+ end
790
+
791
+ # A very simple reporter that prints the "dots" during the run.
792
+ #
793
+ # This is added to the top-level CompositeReporter at the start of
794
+ # the run. If you want to change the output of minitest via a
795
+ # plugin, pull this out of the composite and replace it with your
796
+ # own.
797
+ #
798
+ # pkg:gem/minitest#lib/minitest.rb:779
799
+ class Minitest::ProgressReporter < ::Minitest::Reporter
800
+ # pkg:gem/minitest#lib/minitest.rb:780
801
+ def prerecord(klass, name); end
802
+
803
+ # pkg:gem/minitest#lib/minitest.rb:787
804
+ def record(result); end
805
+ end
806
+
807
+ # Shared code for anything that can get passed to a Reporter. See
808
+ # Minitest::Test & Minitest::Result.
809
+ #
810
+ # pkg:gem/minitest#lib/minitest.rb:604
811
+ module Minitest::Reportable
812
+ # pkg:gem/minitest#lib/minitest.rb:626
813
+ def class_name; end
814
+
815
+ # Did this run error?
816
+ #
817
+ # pkg:gem/minitest#lib/minitest.rb:647
818
+ def error?; end
819
+
820
+ # The location identifier of this test. Depends on a method
821
+ # existing called class_name.
822
+ #
823
+ # pkg:gem/minitest#lib/minitest.rb:621
824
+ def location; end
825
+
826
+ # Did this run pass?
827
+ #
828
+ # Note: skipped runs are not considered passing, but they don't
829
+ # cause the process to exit non-zero.
830
+ #
831
+ # pkg:gem/minitest#lib/minitest.rb:611
832
+ def passed?; end
833
+
834
+ # Returns ".", "F", or "E" based on the result of the run.
835
+ #
836
+ # pkg:gem/minitest#lib/minitest.rb:633
837
+ def result_code; end
838
+
839
+ # Was this run skipped?
840
+ #
841
+ # pkg:gem/minitest#lib/minitest.rb:640
842
+ def skipped?; end
843
+ end
844
+
845
+ # pkg:gem/minitest#lib/minitest.rb:615
846
+ Minitest::Reportable::BASE_DIR = T.let(T.unsafe(nil), String)
847
+
848
+ # AbstractReportera
849
+ #
850
+ # pkg:gem/minitest#lib/minitest.rb:753
851
+ class Minitest::Reporter < ::Minitest::AbstractReporter
852
+ # pkg:gem/minitest#lib/minitest.rb:764
853
+ def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end
854
+
855
+ # The IO used to report.
856
+ #
857
+ # pkg:gem/minitest#lib/minitest.rb:757
858
+ def io; end
859
+
860
+ # The IO used to report.
861
+ #
862
+ # pkg:gem/minitest#lib/minitest.rb:757
863
+ def io=(_arg0); end
864
+
865
+ # Command-line options for this run.
866
+ #
867
+ # pkg:gem/minitest#lib/minitest.rb:762
868
+ def options; end
869
+
870
+ # Command-line options for this run.
871
+ #
872
+ # pkg:gem/minitest#lib/minitest.rb:762
873
+ def options=(_arg0); end
874
+ end
875
+
876
+ # This represents a test result in a clean way that can be
877
+ # marshalled over a wire. Tests can do anything they want to the
878
+ # test instance and can create conditions that cause Marshal.dump to
879
+ # blow up. By using Result.from(a_test) you can be reasonably sure
880
+ # that the test result can be marshalled.
881
+ #
882
+ # pkg:gem/minitest#lib/minitest.rb:659
883
+ class Minitest::Result < ::Minitest::Runnable
884
+ include ::Minitest::Reportable
885
+
886
+ # pkg:gem/minitest#lib/minitest.rb:690
887
+ def class_name; end
888
+
889
+ # The class name of the test result.
890
+ #
891
+ # pkg:gem/minitest#lib/minitest.rb:665
892
+ def klass; end
893
+
894
+ # The class name of the test result.
895
+ #
896
+ # pkg:gem/minitest#lib/minitest.rb:665
897
+ def klass=(_arg0); end
898
+
899
+ # The location of the test method.
900
+ #
901
+ # pkg:gem/minitest#lib/minitest.rb:670
902
+ def source_location; end
903
+
904
+ # The location of the test method.
905
+ #
906
+ # pkg:gem/minitest#lib/minitest.rb:670
907
+ def source_location=(_arg0); end
908
+
909
+ # pkg:gem/minitest#lib/minitest.rb:694
910
+ def to_s; end
911
+
912
+ class << self
913
+ # Create a new test result from a Runnable instance.
914
+ #
915
+ # pkg:gem/minitest#lib/minitest.rb:675
916
+ def from(runnable); end
917
+ end
918
+ end
919
+
920
+ # Represents anything "runnable", like Test, Spec, Benchmark, or
921
+ # whatever you can dream up.
922
+ #
923
+ # Subclasses of this are automatically registered and available in
924
+ # Runnable.runnables.
925
+ #
926
+ # pkg:gem/minitest#lib/minitest.rb:378
927
+ class Minitest::Runnable
928
+ # pkg:gem/minitest#lib/minitest.rb:535
929
+ def initialize(name); end
930
+
931
+ # Number of assertions executed in this run.
932
+ #
933
+ # pkg:gem/minitest#lib/minitest.rb:382
934
+ def assertions; end
935
+
936
+ # Number of assertions executed in this run.
937
+ #
938
+ # pkg:gem/minitest#lib/minitest.rb:382
939
+ def assertions=(_arg0); end
940
+
941
+ # pkg:gem/minitest#lib/minitest.rb:531
942
+ def failure; end
943
+
944
+ # An assertion raised during the run, if any.
945
+ #
946
+ # pkg:gem/minitest#lib/minitest.rb:387
947
+ def failures; end
948
+
949
+ # An assertion raised during the run, if any.
950
+ #
951
+ # pkg:gem/minitest#lib/minitest.rb:387
952
+ def failures=(_arg0); end
953
+
954
+ # Metadata you attach to the test results that get sent to the reporter.
955
+ #
956
+ # Lazily initializes to a hash, to keep memory down.
957
+ #
958
+ # NOTE: this data *must* be plain (read: marshal-able) data!
959
+ # Hashes! Arrays! Strings!
960
+ #
961
+ # Sets metadata, mainly used for +Result.from+.
962
+ #
963
+ # pkg:gem/minitest#lib/minitest.rb:550
964
+ def metadata; end
965
+
966
+ # Metadata you attach to the test results that get sent to the reporter.
967
+ #
968
+ # Lazily initializes to a hash, to keep memory down.
969
+ #
970
+ # NOTE: this data *must* be plain (read: marshal-able) data!
971
+ # Hashes! Arrays! Strings!
972
+ #
973
+ # Sets metadata, mainly used for +Result.from+.
974
+ #
975
+ # pkg:gem/minitest#lib/minitest.rb:557
976
+ def metadata=(_arg0); end
977
+
978
+ # Returns true if metadata exists.
979
+ #
980
+ # pkg:gem/minitest#lib/minitest.rb:562
981
+ def metadata?; end
982
+
983
+ # Name of the run.
984
+ #
985
+ # pkg:gem/minitest#lib/minitest.rb:405
986
+ def name; end
987
+
988
+ # Set the name of the run.
989
+ #
990
+ # pkg:gem/minitest#lib/minitest.rb:412
991
+ def name=(o); end
992
+
993
+ # Did this run pass?
994
+ #
995
+ # Note: skipped runs are not considered passing, but they don't
996
+ # cause the process to exit non-zero.
997
+ #
998
+ # pkg:gem/minitest#lib/minitest.rb:579
999
+ def passed?; end
1000
+
1001
+ # Returns a single character string to print based on the result
1002
+ # of the run. One of <tt>"."</tt>, <tt>"F"</tt>,
1003
+ # <tt>"E"</tt> or <tt>"S"</tt>.
1004
+ #
1005
+ # pkg:gem/minitest#lib/minitest.rb:588
1006
+ def result_code; end
1007
+
1008
+ # Runs a single method. Needs to return self.
1009
+ #
1010
+ # pkg:gem/minitest#lib/minitest.rb:569
1011
+ def run; end
1012
+
1013
+ # Was this run skipped? See #passed? for more information.
1014
+ #
1015
+ # pkg:gem/minitest#lib/minitest.rb:595
1016
+ def skipped?; end
1017
+
1018
+ # The time it took to run.
1019
+ #
1020
+ # pkg:gem/minitest#lib/minitest.rb:392
1021
+ def time; end
1022
+
1023
+ # The time it took to run.
1024
+ #
1025
+ # pkg:gem/minitest#lib/minitest.rb:392
1026
+ def time=(_arg0); end
1027
+
1028
+ # pkg:gem/minitest#lib/minitest.rb:394
1029
+ def time_it; end
1030
+
1031
+ class << self
1032
+ # Returns an array of filtered +runnable_methods+. Uses
1033
+ # options[:include] (--include arguments) and options[:exclude]
1034
+ # (--exclude arguments) values to filter.
1035
+ #
1036
+ # pkg:gem/minitest#lib/minitest.rb:434
1037
+ def filter_runnable_methods(options = T.unsafe(nil)); end
1038
+
1039
+ # re-open
1040
+ #
1041
+ # pkg:gem/minitest#lib/minitest.rb:1219
1042
+ def inherited(klass); end
1043
+
1044
+ # Returns all instance methods matching the pattern +re+.
1045
+ #
1046
+ # pkg:gem/minitest#lib/minitest.rb:419
1047
+ def methods_matching(re); end
1048
+
1049
+ # pkg:gem/minitest#lib/minitest.rb:503
1050
+ def on_signal(name, action); end
1051
+
1052
+ # pkg:gem/minitest#lib/minitest.rb:423
1053
+ def reset; end
1054
+
1055
+ # Runs a single method and has the reporter record the result.
1056
+ # This was considered internal API but is factored out of run so
1057
+ # that subclasses can specialize the running of an individual
1058
+ # test. See Minitest::ParallelTest::ClassMethods for an example.
1059
+ #
1060
+ # pkg:gem/minitest#lib/minitest.rb:484
1061
+ def run(klass, method_name, reporter); end
1062
+
1063
+ # Defines the order to run tests (:random by default). Override
1064
+ # this or use a convenience method to change it for your tests.
1065
+ #
1066
+ # pkg:gem/minitest#lib/minitest.rb:493
1067
+ def run_order; end
1068
+
1069
+ # Responsible for running all runnable methods in a given class,
1070
+ # each in its own instance. Each instance is passed to the
1071
+ # reporter to record.
1072
+ #
1073
+ # pkg:gem/minitest#lib/minitest.rb:452
1074
+ def run_suite(reporter, options = T.unsafe(nil)); end
1075
+
1076
+ # Each subclass of Runnable is responsible for overriding this
1077
+ # method to return all runnable methods. See #methods_matching.
1078
+ #
1079
+ # pkg:gem/minitest#lib/minitest.rb:520
1080
+ def runnable_methods; end
1081
+
1082
+ # Returns all subclasses of Runnable.
1083
+ #
1084
+ # pkg:gem/minitest#lib/minitest.rb:527
1085
+ def runnables; end
1086
+
1087
+ # pkg:gem/minitest#lib/minitest.rb:497
1088
+ def with_info_handler(_reporter = T.unsafe(nil), &block); end
1089
+ end
1090
+ end
1091
+
1092
+ # pkg:gem/minitest#lib/minitest.rb:501
1093
+ Minitest::Runnable::SIGNALS = T.let(T.unsafe(nil), Hash)
1094
+
1095
+ # Assertion raised when skipping a run.
1096
+ #
1097
+ # pkg:gem/minitest#lib/minitest.rb:1069
1098
+ class Minitest::Skip < ::Minitest::Assertion
1099
+ # pkg:gem/minitest#lib/minitest.rb:1070
1100
+ def result_label; end
1101
+ end
1102
+
1103
+ # A reporter that gathers statistics about a test run. Does not do
1104
+ # any IO because meant to be used as a parent class for a reporter
1105
+ # that does.
1106
+ #
1107
+ # If you want to create an entirely different type of output (eg,
1108
+ # CI, HTML, etc), this is the place to start.
1109
+ #
1110
+ # Example:
1111
+ #
1112
+ # class JenkinsCIReporter < StatisticsReporter
1113
+ # def report
1114
+ # super # Needed to calculate some statistics
1115
+ #
1116
+ # print "<testsuite "
1117
+ # print "tests='#{count}' "
1118
+ # print "failures='#{failures}' "
1119
+ # # Remaining XML...
1120
+ # end
1121
+ # end
1122
+ #
1123
+ # pkg:gem/minitest#lib/minitest.rb:815
1124
+ class Minitest::StatisticsReporter < ::Minitest::Reporter
1125
+ # pkg:gem/minitest#lib/minitest.rb:864
1126
+ def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end
1127
+
1128
+ # Total number of assertions.
1129
+ #
1130
+ # pkg:gem/minitest#lib/minitest.rb:819
1131
+ def assertions; end
1132
+
1133
+ # Total number of assertions.
1134
+ #
1135
+ # pkg:gem/minitest#lib/minitest.rb:819
1136
+ def assertions=(_arg0); end
1137
+
1138
+ # Total number of test cases.
1139
+ #
1140
+ # pkg:gem/minitest#lib/minitest.rb:824
1141
+ def count; end
1142
+
1143
+ # Total number of test cases.
1144
+ #
1145
+ # pkg:gem/minitest#lib/minitest.rb:824
1146
+ def count=(_arg0); end
1147
+
1148
+ # Total number of tests that erred.
1149
+ #
1150
+ # pkg:gem/minitest#lib/minitest.rb:852
1151
+ def errors; end
1152
+
1153
+ # Total number of tests that erred.
1154
+ #
1155
+ # pkg:gem/minitest#lib/minitest.rb:852
1156
+ def errors=(_arg0); end
1157
+
1158
+ # Total number of tests that failed.
1159
+ #
1160
+ # pkg:gem/minitest#lib/minitest.rb:847
1161
+ def failures; end
1162
+
1163
+ # Total number of tests that failed.
1164
+ #
1165
+ # pkg:gem/minitest#lib/minitest.rb:847
1166
+ def failures=(_arg0); end
1167
+
1168
+ # pkg:gem/minitest#lib/minitest.rb:878
1169
+ def passed?; end
1170
+
1171
+ # pkg:gem/minitest#lib/minitest.rb:886
1172
+ def record(result); end
1173
+
1174
+ # Report on the tracked statistics.
1175
+ #
1176
+ # pkg:gem/minitest#lib/minitest.rb:896
1177
+ def report; end
1178
+
1179
+ # An +Array+ of test cases that failed or were skipped.
1180
+ #
1181
+ # pkg:gem/minitest#lib/minitest.rb:829
1182
+ def results; end
1183
+
1184
+ # An +Array+ of test cases that failed or were skipped.
1185
+ #
1186
+ # pkg:gem/minitest#lib/minitest.rb:829
1187
+ def results=(_arg0); end
1188
+
1189
+ # Total number of tests that where skipped.
1190
+ #
1191
+ # pkg:gem/minitest#lib/minitest.rb:862
1192
+ def skips; end
1193
+
1194
+ # Total number of tests that where skipped.
1195
+ #
1196
+ # pkg:gem/minitest#lib/minitest.rb:862
1197
+ def skips=(_arg0); end
1198
+
1199
+ # pkg:gem/minitest#lib/minitest.rb:882
1200
+ def start; end
1201
+
1202
+ # Time the test run started. If available, the monotonic clock is
1203
+ # used and this is a +Float+, otherwise it's an instance of
1204
+ # +Time+.
1205
+ #
1206
+ # pkg:gem/minitest#lib/minitest.rb:836
1207
+ def start_time; end
1208
+
1209
+ # Time the test run started. If available, the monotonic clock is
1210
+ # used and this is a +Float+, otherwise it's an instance of
1211
+ # +Time+.
1212
+ #
1213
+ # pkg:gem/minitest#lib/minitest.rb:836
1214
+ def start_time=(_arg0); end
1215
+
1216
+ # Test run time. If available, the monotonic clock is used and
1217
+ # this is a +Float+, otherwise it's an instance of +Time+.
1218
+ #
1219
+ # pkg:gem/minitest#lib/minitest.rb:842
1220
+ def total_time; end
1221
+
1222
+ # Test run time. If available, the monotonic clock is used and
1223
+ # this is a +Float+, otherwise it's an instance of +Time+.
1224
+ #
1225
+ # pkg:gem/minitest#lib/minitest.rb:842
1226
+ def total_time=(_arg0); end
1227
+
1228
+ # Total number of tests that warned.
1229
+ #
1230
+ # pkg:gem/minitest#lib/minitest.rb:857
1231
+ def warnings; end
1232
+
1233
+ # Total number of tests that warned.
1234
+ #
1235
+ # pkg:gem/minitest#lib/minitest.rb:857
1236
+ def warnings=(_arg0); end
1237
+ end
1238
+
1239
+ # A reporter that prints the header, summary, and failure details at
1240
+ # the end of the run.
1241
+ #
1242
+ # This is added to the top-level CompositeReporter at the start of
1243
+ # the run. If you want to change the output of minitest via a
1244
+ # plugin, pull this out of the composite and replace it with your
1245
+ # own.
1246
+ #
1247
+ # pkg:gem/minitest#lib/minitest.rb:917
1248
+ class Minitest::SummaryReporter < ::Minitest::StatisticsReporter
1249
+ # pkg:gem/minitest#lib/minitest.rb:950
1250
+ def aggregated_results(io); end
1251
+
1252
+ # pkg:gem/minitest#lib/minitest.rb:919
1253
+ def old_sync; end
1254
+
1255
+ # pkg:gem/minitest#lib/minitest.rb:919
1256
+ def old_sync=(_arg0); end
1257
+
1258
+ # pkg:gem/minitest#lib/minitest.rb:933
1259
+ def report; end
1260
+
1261
+ # pkg:gem/minitest#lib/minitest.rb:921
1262
+ def start; end
1263
+
1264
+ # pkg:gem/minitest#lib/minitest.rb:945
1265
+ def statistics; end
1266
+
1267
+ # pkg:gem/minitest#lib/minitest.rb:970
1268
+ def summary; end
1269
+
1270
+ # pkg:gem/minitest#lib/minitest.rb:918
1271
+ def sync; end
1272
+
1273
+ # pkg:gem/minitest#lib/minitest.rb:918
1274
+ def sync=(_arg0); end
1275
+
1276
+ # pkg:gem/minitest#lib/minitest.rb:966
1277
+ def to_s; end
1278
+ end
1279
+
1280
+ # Subclass Test to create your own tests. Typically you'll want a
1281
+ # Test subclass per implementation class.
1282
+ #
1283
+ # See Minitest::Assertions
1284
+ #
1285
+ # pkg:gem/minitest#lib/minitest/test.rb:10
1286
+ class Minitest::Test < ::Minitest::Runnable
1287
+ include ::Minitest::Reportable
1288
+ include ::Minitest::Assertions
1289
+ include ::Minitest::Test::LifecycleHooks
1290
+ include ::Minitest::Guard
1291
+ extend ::Minitest::Guard
1292
+
1293
+ # LifecycleHooks
1294
+ #
1295
+ # pkg:gem/minitest#lib/minitest/test.rb:186
1296
+ def capture_exceptions; end
1297
+
1298
+ # pkg:gem/minitest#lib/minitest/test.rb:203
1299
+ def neuter_exception(e); end
1300
+
1301
+ # pkg:gem/minitest#lib/minitest/test.rb:214
1302
+ def new_exception(klass, msg, bt, kill = T.unsafe(nil)); end
1303
+
1304
+ # Runs a single test with setup/teardown hooks.
1305
+ #
1306
+ # pkg:gem/minitest#lib/minitest/test.rb:84
1307
+ def run; end
1308
+
1309
+ # pkg:gem/minitest#lib/minitest/test.rb:196
1310
+ def sanitize_exception(e); end
1311
+
1312
+ class << self
1313
+ # Call this at the top of your tests when you absolutely
1314
+ # positively need to have ordered tests. In doing so, you're
1315
+ # admitting that you suck and your tests are weak.
1316
+ #
1317
+ # pkg:gem/minitest#lib/minitest/test.rb:31
1318
+ def i_suck_and_my_tests_are_order_dependent!; end
1319
+
1320
+ # pkg:gem/minitest#lib/minitest/test.rb:22
1321
+ def io_lock; end
1322
+
1323
+ # pkg:gem/minitest#lib/minitest/test.rb:22
1324
+ def io_lock=(_arg0); end
1325
+
1326
+ # Make diffs for this Test use #pretty_inspect so that diff
1327
+ # in assert_equal can have more details. NOTE: this is much slower
1328
+ # than the regular inspect but much more usable for complex
1329
+ # objects.
1330
+ #
1331
+ # pkg:gem/minitest#lib/minitest/test.rb:44
1332
+ def make_my_diffs_pretty!; end
1333
+
1334
+ # Call this at the top of your tests (inside the +Minitest::Test+
1335
+ # subclass or +describe+ block) when you want to run your tests in
1336
+ # parallel. In doing so, you're admitting that you rule and your
1337
+ # tests are awesome.
1338
+ #
1339
+ # pkg:gem/minitest#lib/minitest/test.rb:56
1340
+ def parallelize_me!; end
1341
+
1342
+ # Returns all instance methods starting with "test_". Based on
1343
+ # #run_order, the methods are either sorted, randomized
1344
+ # (default), or run in parallel.
1345
+ #
1346
+ # pkg:gem/minitest#lib/minitest/test.rb:67
1347
+ def runnable_methods; end
1348
+ end
1349
+ end
1350
+
1351
+ # Provides before/after hooks for setup and teardown. These are
1352
+ # meant for library writers, NOT for regular test authors. See
1353
+ # #before_setup for an example.
1354
+ #
1355
+ # pkg:gem/minitest#lib/minitest/test.rb:109
1356
+ module Minitest::Test::LifecycleHooks
1357
+ # Runs before every test, after setup. This hook is meant for
1358
+ # libraries to extend minitest. It is not meant to be used by
1359
+ # test developers.
1360
+ #
1361
+ # See #before_setup for an example.
1362
+ #
1363
+ # pkg:gem/minitest#lib/minitest/test.rb:159
1364
+ def after_setup; end
1365
+
1366
+ # Runs after every test, after teardown. This hook is meant for
1367
+ # libraries to extend minitest. It is not meant to be used by
1368
+ # test developers.
1369
+ #
1370
+ # See #before_setup for an example.
1371
+ #
1372
+ # pkg:gem/minitest#lib/minitest/test.rb:183
1373
+ def after_teardown; end
1374
+
1375
+ # Runs before every test, before setup. This hook is meant for
1376
+ # libraries to extend minitest. It is not meant to be used by
1377
+ # test developers.
1378
+ #
1379
+ # As a simplistic example:
1380
+ #
1381
+ # module MyMinitestPlugin
1382
+ # def before_setup
1383
+ # super
1384
+ # # ... stuff to do before setup is run
1385
+ # end
1386
+ #
1387
+ # def after_setup
1388
+ # # ... stuff to do after setup is run
1389
+ # super
1390
+ # end
1391
+ #
1392
+ # def before_teardown
1393
+ # super
1394
+ # # ... stuff to do before teardown is run
1395
+ # end
1396
+ #
1397
+ # def after_teardown
1398
+ # # ... stuff to do after teardown is run
1399
+ # super
1400
+ # end
1401
+ # end
1402
+ #
1403
+ # class Minitest::Test
1404
+ # include MyMinitestPlugin
1405
+ # end
1406
+ #
1407
+ # pkg:gem/minitest#lib/minitest/test.rb:144
1408
+ def before_setup; end
1409
+
1410
+ # Runs after every test, before teardown. This hook is meant for
1411
+ # libraries to extend minitest. It is not meant to be used by
1412
+ # test developers.
1413
+ #
1414
+ # See #before_setup for an example.
1415
+ #
1416
+ # pkg:gem/minitest#lib/minitest/test.rb:168
1417
+ def before_teardown; end
1418
+
1419
+ # Runs before every test. Use this to set up before each test
1420
+ # run.
1421
+ #
1422
+ # pkg:gem/minitest#lib/minitest/test.rb:150
1423
+ def setup; end
1424
+
1425
+ # Runs after every test. Use this to clean up after each test
1426
+ # run.
1427
+ #
1428
+ # pkg:gem/minitest#lib/minitest/test.rb:174
1429
+ def teardown; end
1430
+ end
1431
+
1432
+ # pkg:gem/minitest#lib/minitest/test.rb:15
1433
+ Minitest::Test::PASSTHROUGH_EXCEPTIONS = T.let(T.unsafe(nil), Array)
1434
+
1435
+ # pkg:gem/minitest#lib/minitest/test.rb:17
1436
+ Minitest::Test::SETUP_METHODS = T.let(T.unsafe(nil), Array)
1437
+
1438
+ # pkg:gem/minitest#lib/minitest/test.rb:19
1439
+ Minitest::Test::TEARDOWN_METHODS = T.let(T.unsafe(nil), Array)
1440
+
1441
+ # Assertion wrapping an unexpected error that was raised during a run.
1442
+ #
1443
+ # pkg:gem/minitest#lib/minitest.rb:1078
1444
+ class Minitest::UnexpectedError < ::Minitest::Assertion
1445
+ include ::Minitest::Compress
1446
+
1447
+ # pkg:gem/minitest#lib/minitest.rb:1084
1448
+ def initialize(error); end
1449
+
1450
+ # pkg:gem/minitest#lib/minitest.rb:1097
1451
+ def backtrace; end
1452
+
1453
+ # TODO: figure out how to use `cause` instead
1454
+ #
1455
+ # pkg:gem/minitest#lib/minitest.rb:1082
1456
+ def error; end
1457
+
1458
+ # TODO: figure out how to use `cause` instead
1459
+ #
1460
+ # pkg:gem/minitest#lib/minitest.rb:1082
1461
+ def error=(_arg0); end
1462
+
1463
+ # pkg:gem/minitest#lib/minitest.rb:1103
1464
+ def message; end
1465
+
1466
+ # pkg:gem/minitest#lib/minitest.rb:1109
1467
+ def result_label; end
1468
+ end
1469
+
1470
+ # pkg:gem/minitest#lib/minitest.rb:1101
1471
+ Minitest::UnexpectedError::BASE_RE = T.let(T.unsafe(nil), Regexp)
1472
+
1473
+ # Assertion raised on warning when running in -Werror mode.
1474
+ #
1475
+ # pkg:gem/minitest#lib/minitest.rb:1117
1476
+ class Minitest::UnexpectedWarning < ::Minitest::Assertion
1477
+ # pkg:gem/minitest#lib/minitest.rb:1118
1478
+ def result_label; end
1479
+ end
1480
+
1481
+ # pkg:gem/minitest#lib/minitest.rb:13
1482
+ Minitest::VERSION = T.let(T.unsafe(nil), String)