sorbet-schema 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 (89) hide show
  1. checksums.yaml +7 -0
  2. data/.ruby-version +1 -0
  3. data/.standard.yml +6 -0
  4. data/.tool-versions +1 -0
  5. data/CHANGELOG.md +24 -0
  6. data/CODE_OF_CONDUCT.md +84 -0
  7. data/Gemfile +25 -0
  8. data/Gemfile.lock +147 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +43 -0
  11. data/Rakefile +22 -0
  12. data/lib/sorbet-schema/hash_transformer.rb +22 -0
  13. data/lib/sorbet-schema/struct_ext.rb +37 -0
  14. data/lib/sorbet-schema/version.rb +5 -0
  15. data/lib/sorbet-schema.rb +27 -0
  16. data/lib/typed/coercion/coercer.rb +18 -0
  17. data/lib/typed/coercion/coercion_error.rb +7 -0
  18. data/lib/typed/coercion/coercion_not_supported_error.rb +7 -0
  19. data/lib/typed/coercion/float_coercer.rb +21 -0
  20. data/lib/typed/coercion/integer_coercer.rb +21 -0
  21. data/lib/typed/coercion/string_coercer.rb +19 -0
  22. data/lib/typed/coercion/struct_coercer.rb +26 -0
  23. data/lib/typed/coercion.rb +26 -0
  24. data/lib/typed/deserialize_error.rb +6 -0
  25. data/lib/typed/field.rb +28 -0
  26. data/lib/typed/hash_serializer.rb +21 -0
  27. data/lib/typed/json_serializer.rb +28 -0
  28. data/lib/typed/parse_error.rb +12 -0
  29. data/lib/typed/schema.rb +10 -0
  30. data/lib/typed/serializer.rb +61 -0
  31. data/lib/typed/validations/field_type_validator.rb +24 -0
  32. data/lib/typed/validations/field_validator.rb +15 -0
  33. data/lib/typed/validations/multiple_validation_error.rb +16 -0
  34. data/lib/typed/validations/required_field_error.rb +14 -0
  35. data/lib/typed/validations/type_mismatch_error.rb +14 -0
  36. data/lib/typed/validations/validated_value.rb +12 -0
  37. data/lib/typed/validations/validation_error.rb +8 -0
  38. data/lib/typed/validations/validation_results.rb +29 -0
  39. data/lib/typed/validations.rb +8 -0
  40. data/sorbet/config +5 -0
  41. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  42. data/sorbet/rbi/gems/.gitattributes +1 -0
  43. data/sorbet/rbi/gems/ansi@1.5.0.rbi +687 -0
  44. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  45. data/sorbet/rbi/gems/builder@3.2.4.rbi +504 -0
  46. data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
  47. data/sorbet/rbi/gems/io-console@0.7.2.rbi +8 -0
  48. data/sorbet/rbi/gems/json@2.7.1.rbi +1553 -0
  49. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  50. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +239 -0
  51. data/sorbet/rbi/gems/minitest-focus@1.4.0.rbi +91 -0
  52. data/sorbet/rbi/gems/minitest-reporters@1.6.1.rbi +1010 -0
  53. data/sorbet/rbi/gems/minitest@5.22.2.rbi +2233 -0
  54. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  55. data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
  56. data/sorbet/rbi/gems/parser@3.3.0.5.rbi +5472 -0
  57. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  58. data/sorbet/rbi/gems/prism@0.24.0.rbi +31040 -0
  59. data/sorbet/rbi/gems/psych@5.1.2.rbi +1731 -0
  60. data/sorbet/rbi/gems/racc@1.7.3.rbi +157 -0
  61. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  62. data/sorbet/rbi/gems/rake@13.1.0.rbi +3027 -0
  63. data/sorbet/rbi/gems/rbi@0.1.9.rbi +3006 -0
  64. data/sorbet/rbi/gems/regexp_parser@2.9.0.rbi +3771 -0
  65. data/sorbet/rbi/gems/reline@0.4.3.rbi +8 -0
  66. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
  67. data/sorbet/rbi/gems/rubocop-ast@1.31.1.rbi +7014 -0
  68. data/sorbet/rbi/gems/rubocop-performance@1.20.2.rbi +8 -0
  69. data/sorbet/rbi/gems/rubocop-sorbet@0.7.7.rbi +8 -0
  70. data/sorbet/rbi/gems/rubocop@1.61.0.rbi +57499 -0
  71. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  72. data/sorbet/rbi/gems/sorbet-result@1.1.0.rbi +519 -0
  73. data/sorbet/rbi/gems/sorbet-struct-comparable@1.3.0.rbi +34 -0
  74. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  75. data/sorbet/rbi/gems/standard-custom@1.0.2.rbi +8 -0
  76. data/sorbet/rbi/gems/standard-performance@1.3.1.rbi +80 -0
  77. data/sorbet/rbi/gems/standard-sorbet@0.0.2.rbi +52 -0
  78. data/sorbet/rbi/gems/standard@1.34.0.rbi +850 -0
  79. data/sorbet/rbi/gems/stringio@3.1.0.rbi +8 -0
  80. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23133 -0
  81. data/sorbet/rbi/gems/tapioca@0.12.0.rbi +3499 -0
  82. data/sorbet/rbi/gems/thor@1.3.1.rbi +4351 -0
  83. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  84. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  85. data/sorbet/rbi/gems/yard@0.9.36.rbi +18220 -0
  86. data/sorbet/rbi/gems/zeitwerk@2.6.13.rbi +1003 -0
  87. data/sorbet/tapioca/config.yml +4 -0
  88. data/sorbet/tapioca/require.rb +12 -0
  89. metadata +191 -0
@@ -0,0 +1,2233 @@
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
+ # Kernel extensions for minitest
8
+ #
9
+ # source://minitest//lib/minitest/spec.rb#46
10
+ module Kernel
11
+ private
12
+
13
+ # Describe a series of expectations for a given target +desc+.
14
+ #
15
+ # Defines a test class subclassing from either Minitest::Spec or
16
+ # from the surrounding describe's class. The surrounding class may
17
+ # subclass Minitest::Spec manually in order to easily share code:
18
+ #
19
+ # class MySpec < Minitest::Spec
20
+ # # ... shared code ...
21
+ # end
22
+ #
23
+ # class TestStuff < MySpec
24
+ # it "does stuff" do
25
+ # # shared code available here
26
+ # end
27
+ # describe "inner stuff" do
28
+ # it "still does stuff" do
29
+ # # ...and here
30
+ # end
31
+ # end
32
+ # end
33
+ #
34
+ # For more information on getting started with writing specs, see:
35
+ #
36
+ # http://www.rubyinside.com/a-minitestspec-tutorial-elegant-spec-style-testing-that-comes-with-ruby-5354.html
37
+ #
38
+ # For some suggestions on how to improve your specs, try:
39
+ #
40
+ # https://betterspecs.org
41
+ #
42
+ # but do note that several items there are debatable or specific to
43
+ # rspec.
44
+ #
45
+ # For more information about expectations, see Minitest::Expectations.
46
+ #
47
+ # source://minitest//lib/minitest/spec.rb#82
48
+ def describe(desc, *additional_desc, &block); end
49
+ end
50
+
51
+ # :include: README.rdoc
52
+ #
53
+ # source://minitest//lib/minitest/parallel.rb#1
54
+ module Minitest
55
+ class << self
56
+ # Internal run method. Responsible for telling all Runnable
57
+ # sub-classes to run.
58
+ #
59
+ # source://minitest//lib/minitest.rb#197
60
+ def __run(reporter, options); end
61
+
62
+ # A simple hook allowing you to run a block of code after everything
63
+ # is done running. Eg:
64
+ #
65
+ # Minitest.after_run { p $debugging_info }
66
+ #
67
+ # source://minitest//lib/minitest.rb#97
68
+ def after_run(&block); end
69
+
70
+ # source://minitest//lib/minitest.rb#19
71
+ def allow_fork; end
72
+
73
+ # source://minitest//lib/minitest.rb#19
74
+ def allow_fork=(_arg0); end
75
+
76
+ # Registers Minitest to run at process exit
77
+ #
78
+ # source://minitest//lib/minitest.rb#69
79
+ def autorun; end
80
+
81
+ # source://minitest//lib/minitest.rb#19
82
+ def backtrace_filter; end
83
+
84
+ # source://minitest//lib/minitest.rb#19
85
+ def backtrace_filter=(_arg0); end
86
+
87
+ # source://minitest//lib/minitest.rb#18
88
+ def cattr_accessor(name); end
89
+
90
+ # source://minitest//lib/minitest.rb#1146
91
+ def clock_time; end
92
+
93
+ # source://minitest//lib/minitest.rb#177
94
+ def empty_run!(options); end
95
+
96
+ # source://minitest//lib/minitest.rb#19
97
+ def extensions; end
98
+
99
+ # source://minitest//lib/minitest.rb#19
100
+ def extensions=(_arg0); end
101
+
102
+ # source://minitest//lib/minitest.rb#292
103
+ def filter_backtrace(bt); end
104
+
105
+ # source://minitest//lib/minitest.rb#19
106
+ def info_signal; end
107
+
108
+ # source://minitest//lib/minitest.rb#19
109
+ def info_signal=(_arg0); end
110
+
111
+ # source://minitest//lib/minitest.rb#101
112
+ def init_plugins(options); end
113
+
114
+ # source://minitest//lib/minitest.rb#108
115
+ def load_plugins; end
116
+
117
+ # source://minitest//lib/minitest.rb#19
118
+ def parallel_executor; end
119
+
120
+ # source://minitest//lib/minitest.rb#19
121
+ def parallel_executor=(_arg0); end
122
+
123
+ # source://minitest//lib/minitest.rb#210
124
+ def process_args(args = T.unsafe(nil)); end
125
+
126
+ # source://minitest//lib/minitest.rb#19
127
+ def reporter; end
128
+
129
+ # source://minitest//lib/minitest.rb#19
130
+ def reporter=(_arg0); end
131
+
132
+ # This is the top-level run method. Everything starts from here. It
133
+ # tells each Runnable sub-class to run, and each of those are
134
+ # responsible for doing whatever they do.
135
+ #
136
+ # The overall structure of a run looks like this:
137
+ #
138
+ # Minitest.autorun
139
+ # Minitest.run(args)
140
+ # Minitest.__run(reporter, options)
141
+ # Runnable.runnables.each
142
+ # runnable_klass.run(reporter, options)
143
+ # self.runnable_methods.each
144
+ # self.run_one_method(self, runnable_method, reporter)
145
+ # Minitest.run_one_method(klass, runnable_method)
146
+ # klass.new(runnable_method).run
147
+ #
148
+ # source://minitest//lib/minitest.rb#143
149
+ def run(args = T.unsafe(nil)); end
150
+
151
+ # source://minitest//lib/minitest.rb#1137
152
+ def run_one_method(klass, method_name); end
153
+
154
+ # source://minitest//lib/minitest.rb#19
155
+ def seed; end
156
+
157
+ # source://minitest//lib/minitest.rb#19
158
+ def seed=(_arg0); end
159
+ end
160
+ end
161
+
162
+ # Defines the API for Reporters. Subclass this and override whatever
163
+ # you want. Go nuts.
164
+ #
165
+ # source://minitest//lib/minitest.rb#638
166
+ class Minitest::AbstractReporter
167
+ # @return [AbstractReporter] a new instance of AbstractReporter
168
+ #
169
+ # source://minitest//lib/minitest.rb#640
170
+ def initialize; end
171
+
172
+ # Did this run pass?
173
+ #
174
+ # @return [Boolean]
175
+ #
176
+ # source://minitest//lib/minitest.rb#675
177
+ def passed?; end
178
+
179
+ # About to start running a test. This allows a reporter to show
180
+ # that it is starting or that we are in the middle of a test run.
181
+ #
182
+ # source://minitest//lib/minitest.rb#654
183
+ def prerecord(klass, name); end
184
+
185
+ # Output and record the result of the test. Call
186
+ # {result#result_code}[rdoc-ref:Runnable#result_code] to get the
187
+ # result character string. Stores the result of the run if the run
188
+ # did not pass.
189
+ #
190
+ # source://minitest//lib/minitest.rb#663
191
+ def record(result); end
192
+
193
+ # Outputs the summary of the run.
194
+ #
195
+ # source://minitest//lib/minitest.rb#669
196
+ def report; end
197
+
198
+ # Starts reporting on the run.
199
+ #
200
+ # source://minitest//lib/minitest.rb#647
201
+ def start; end
202
+
203
+ # source://minitest//lib/minitest.rb#679
204
+ def synchronize(&block); end
205
+ end
206
+
207
+ # Represents run failures.
208
+ #
209
+ # source://minitest//lib/minitest.rb#962
210
+ class Minitest::Assertion < ::Exception
211
+ # source://minitest//lib/minitest.rb#965
212
+ def error; end
213
+
214
+ # Where was this run before an assertion was raised?
215
+ #
216
+ # source://minitest//lib/minitest.rb#972
217
+ def location; end
218
+
219
+ # source://minitest//lib/minitest.rb#980
220
+ def result_code; end
221
+
222
+ # source://minitest//lib/minitest.rb#984
223
+ def result_label; end
224
+ end
225
+
226
+ # source://minitest//lib/minitest.rb#963
227
+ Minitest::Assertion::RE = T.let(T.unsafe(nil), Regexp)
228
+
229
+ # Minitest Assertions. All assertion methods accept a +msg+ which is
230
+ # printed if the assertion fails.
231
+ #
232
+ # Protocol: Nearly everything here boils up to +assert+, which
233
+ # expects to be able to increment an instance accessor named
234
+ # +assertions+. This is not provided by Assertions and must be
235
+ # provided by the thing including Assertions. See Minitest::Runnable
236
+ # for an example.
237
+ #
238
+ # source://minitest//lib/minitest/assertions.rb#18
239
+ module Minitest::Assertions
240
+ # source://minitest//lib/minitest/assertions.rb#188
241
+ def _synchronize; end
242
+
243
+ # source://minitest//lib/minitest/assertions.rb#201
244
+ def _where; end
245
+
246
+ # Fails unless +test+ is truthy.
247
+ #
248
+ # source://minitest//lib/minitest/assertions.rb#178
249
+ def assert(test, msg = T.unsafe(nil)); end
250
+
251
+ # Fails unless +obj+ is empty.
252
+ #
253
+ # source://minitest//lib/minitest/assertions.rb#195
254
+ def assert_empty(obj, msg = T.unsafe(nil)); end
255
+
256
+ # Fails unless <tt>exp == act</tt> printing the difference between
257
+ # the two, if possible.
258
+ #
259
+ # If there is no visible difference but the assertion fails, you
260
+ # should suspect that your #== is buggy, or your inspect output is
261
+ # missing crucial details. For nicer structural diffing, set
262
+ # Minitest::Test.make_my_diffs_pretty!
263
+ #
264
+ # For floats use assert_in_delta.
265
+ #
266
+ # See also: Minitest::Assertions.diff
267
+ #
268
+ # source://minitest//lib/minitest/assertions.rb#221
269
+ def assert_equal(exp, act, msg = T.unsafe(nil)); end
270
+
271
+ # source://sorbet-result/1.1.0/lib/minitest/result_assertions.rb#24
272
+ def assert_error(exp, result); end
273
+
274
+ # source://sorbet-result/1.1.0/lib/minitest/result_assertions.rb#14
275
+ def assert_failure(result); end
276
+
277
+ # For comparing Floats. Fails unless +exp+ and +act+ are within +delta+
278
+ # of each other.
279
+ #
280
+ # assert_in_delta Math::PI, (22.0 / 7.0), 0.01
281
+ #
282
+ # source://minitest//lib/minitest/assertions.rb#242
283
+ def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end
284
+
285
+ # For comparing Floats. Fails unless +exp+ and +act+ have a relative
286
+ # error less than +epsilon+.
287
+ #
288
+ # source://minitest//lib/minitest/assertions.rb#254
289
+ def assert_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end
290
+
291
+ # Fails unless +collection+ includes +obj+.
292
+ #
293
+ # source://minitest//lib/minitest/assertions.rb#261
294
+ def assert_includes(collection, obj, msg = T.unsafe(nil)); end
295
+
296
+ # Fails unless +obj+ is an instance of +cls+.
297
+ #
298
+ # source://minitest//lib/minitest/assertions.rb#272
299
+ def assert_instance_of(cls, obj, msg = T.unsafe(nil)); end
300
+
301
+ # Fails unless +obj+ is a kind of +cls+.
302
+ #
303
+ # source://minitest//lib/minitest/assertions.rb#283
304
+ def assert_kind_of(cls, obj, msg = T.unsafe(nil)); end
305
+
306
+ # Fails unless +matcher+ <tt>=~</tt> +obj+.
307
+ #
308
+ # source://minitest//lib/minitest/assertions.rb#293
309
+ def assert_match(matcher, obj, msg = T.unsafe(nil)); end
310
+
311
+ # Assert that the mock verifies correctly.
312
+ #
313
+ # source://minitest//lib/minitest/mock.rb#250
314
+ def assert_mock(mock); end
315
+
316
+ # Fails unless +obj+ is nil
317
+ #
318
+ # source://minitest//lib/minitest/assertions.rb#305
319
+ def assert_nil(obj, msg = T.unsafe(nil)); end
320
+
321
+ # For testing with binary operators. Eg:
322
+ #
323
+ # assert_operator 5, :<=, 4
324
+ #
325
+ # source://minitest//lib/minitest/assertions.rb#315
326
+ def assert_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end
327
+
328
+ # Fails if stdout or stderr do not output the expected results.
329
+ # Pass in nil if you don't care about that streams output. Pass in
330
+ # "" if you require it to be silent. Pass in a regexp if you want
331
+ # to pattern match.
332
+ #
333
+ # assert_output(/hey/) { method_with_output }
334
+ #
335
+ # NOTE: this uses #capture_io, not #capture_subprocess_io.
336
+ #
337
+ # See also: #assert_silent
338
+ #
339
+ # source://minitest//lib/minitest/assertions.rb#333
340
+ def assert_output(stdout = T.unsafe(nil), stderr = T.unsafe(nil)); end
341
+
342
+ # Fails unless +path+ exists.
343
+ #
344
+ # source://minitest//lib/minitest/assertions.rb#357
345
+ def assert_path_exists(path, msg = T.unsafe(nil)); end
346
+
347
+ # For testing with pattern matching (only supported with Ruby 3.0 and later)
348
+ #
349
+ # # pass
350
+ # assert_pattern { [1,2,3] => [Integer, Integer, Integer] }
351
+ #
352
+ # # fail "length mismatch (given 3, expected 1)"
353
+ # assert_pattern { [1,2,3] => [Integer] }
354
+ #
355
+ # The bare <tt>=></tt> pattern will raise a NoMatchingPatternError on failure, which would
356
+ # normally be counted as a test error. This assertion rescues NoMatchingPatternError and
357
+ # generates a test failure. Any other exception will be raised as normal and generate a test
358
+ # error.
359
+ #
360
+ # @raise [NotImplementedError]
361
+ #
362
+ # source://minitest//lib/minitest/assertions.rb#376
363
+ def assert_pattern; end
364
+
365
+ # source://sorbet-result/1.1.0/lib/minitest/result_assertions.rb#19
366
+ def assert_payload(exp, result); end
367
+
368
+ # For testing with predicates. Eg:
369
+ #
370
+ # assert_predicate str, :empty?
371
+ #
372
+ # This is really meant for specs and is front-ended by assert_operator:
373
+ #
374
+ # str.must_be :empty?
375
+ #
376
+ # source://minitest//lib/minitest/assertions.rb#397
377
+ def assert_predicate(o1, op, msg = T.unsafe(nil)); end
378
+
379
+ # Fails unless the block raises one of +exp+. Returns the
380
+ # exception matched so you can check the message, attributes, etc.
381
+ #
382
+ # +exp+ takes an optional message on the end to help explain
383
+ # failures and defaults to StandardError if no exception class is
384
+ # passed. Eg:
385
+ #
386
+ # assert_raises(CustomError) { method_with_custom_error }
387
+ #
388
+ # With custom error message:
389
+ #
390
+ # assert_raises(CustomError, 'This should have raised CustomError') { method_with_custom_error }
391
+ #
392
+ # Using the returned object:
393
+ #
394
+ # error = assert_raises(CustomError) do
395
+ # raise CustomError, 'This is really bad'
396
+ # end
397
+ #
398
+ # assert_equal 'This is really bad', error.message
399
+ #
400
+ # source://minitest//lib/minitest/assertions.rb#424
401
+ def assert_raises(*exp); end
402
+
403
+ # Fails unless +obj+ responds to +meth+.
404
+ # include_all defaults to false to match Object#respond_to?
405
+ #
406
+ # source://minitest//lib/minitest/assertions.rb#456
407
+ def assert_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end
408
+
409
+ # Fails unless +exp+ and +act+ are #equal?
410
+ #
411
+ # source://minitest//lib/minitest/assertions.rb#466
412
+ def assert_same(exp, act, msg = T.unsafe(nil)); end
413
+
414
+ # +send_ary+ is a receiver, message and arguments.
415
+ #
416
+ # Fails unless the call returns a true value
417
+ #
418
+ # source://minitest//lib/minitest/assertions.rb#479
419
+ def assert_send(send_ary, m = T.unsafe(nil)); end
420
+
421
+ # Fails if the block outputs anything to stderr or stdout.
422
+ #
423
+ # See also: #assert_output
424
+ #
425
+ # source://minitest//lib/minitest/assertions.rb#493
426
+ def assert_silent; end
427
+
428
+ # source://sorbet-result/1.1.0/lib/minitest/result_assertions.rb#9
429
+ def assert_success(result); end
430
+
431
+ # Fails unless the block throws +sym+
432
+ #
433
+ # source://minitest//lib/minitest/assertions.rb#502
434
+ def assert_throws(sym, msg = T.unsafe(nil)); end
435
+
436
+ # Captures $stdout and $stderr into strings:
437
+ #
438
+ # out, err = capture_io do
439
+ # puts "Some info"
440
+ # warn "You did a bad thing"
441
+ # end
442
+ #
443
+ # assert_match %r%info%, out
444
+ # assert_match %r%bad%, err
445
+ #
446
+ # NOTE: For efficiency, this method uses StringIO and does not
447
+ # capture IO for subprocesses. Use #capture_subprocess_io for
448
+ # that.
449
+ #
450
+ # source://minitest//lib/minitest/assertions.rb#543
451
+ def capture_io; end
452
+
453
+ # Captures $stdout and $stderr into strings, using Tempfile to
454
+ # ensure that subprocess IO is captured as well.
455
+ #
456
+ # out, err = capture_subprocess_io do
457
+ # system "echo Some info"
458
+ # system "echo You did a bad thing 1>&2"
459
+ # end
460
+ #
461
+ # assert_match %r%info%, out
462
+ # assert_match %r%bad%, err
463
+ #
464
+ # NOTE: This method is approximately 10x slower than #capture_io so
465
+ # only use it when you need to test the output of a subprocess.
466
+ #
467
+ # source://minitest//lib/minitest/assertions.rb#576
468
+ def capture_subprocess_io; end
469
+
470
+ # Returns a diff between +exp+ and +act+. If there is no known
471
+ # diff command or if it doesn't make sense to diff the output
472
+ # (single line, short output), then it simply returns a basic
473
+ # comparison between the two.
474
+ #
475
+ # See +things_to_diff+ for more info.
476
+ #
477
+ # source://minitest//lib/minitest/assertions.rb#59
478
+ def diff(exp, act); end
479
+
480
+ # Returns details for exception +e+
481
+ #
482
+ # source://minitest//lib/minitest/assertions.rb#608
483
+ def exception_details(e, msg); end
484
+
485
+ # Fails after a given date (in the local time zone). This allows
486
+ # you to put time-bombs in your tests if you need to keep
487
+ # something around until a later date lest you forget about it.
488
+ #
489
+ # source://minitest//lib/minitest/assertions.rb#624
490
+ def fail_after(y, m, d, msg); end
491
+
492
+ # Fails with +msg+.
493
+ #
494
+ # source://minitest//lib/minitest/assertions.rb#631
495
+ def flunk(msg = T.unsafe(nil)); end
496
+
497
+ # Returns a proc that will output +msg+ along with the default message.
498
+ #
499
+ # source://minitest//lib/minitest/assertions.rb#639
500
+ def message(msg = T.unsafe(nil), ending = T.unsafe(nil), &default); end
501
+
502
+ # This returns a human-readable version of +obj+. By default
503
+ # #inspect is called. You can override this to use #pretty_inspect
504
+ # if you want.
505
+ #
506
+ # See Minitest::Test.make_my_diffs_pretty!
507
+ #
508
+ # source://minitest//lib/minitest/assertions.rb#129
509
+ def mu_pp(obj); end
510
+
511
+ # This returns a diff-able more human-readable version of +obj+.
512
+ # This differs from the regular mu_pp because it expands escaped
513
+ # newlines and makes hex-values (like object_ids) generic. This
514
+ # uses mu_pp to do the first pass and then cleans it up.
515
+ #
516
+ # source://minitest//lib/minitest/assertions.rb#152
517
+ def mu_pp_for_diff(obj); end
518
+
519
+ # used for counting assertions
520
+ #
521
+ # source://minitest//lib/minitest/assertions.rb#650
522
+ def pass(_msg = T.unsafe(nil)); end
523
+
524
+ # Fails if +test+ is truthy.
525
+ #
526
+ # source://minitest//lib/minitest/assertions.rb#657
527
+ def refute(test, msg = T.unsafe(nil)); end
528
+
529
+ # Fails if +obj+ is empty.
530
+ #
531
+ # source://minitest//lib/minitest/assertions.rb#665
532
+ def refute_empty(obj, msg = T.unsafe(nil)); end
533
+
534
+ # Fails if <tt>exp == act</tt>.
535
+ #
536
+ # For floats use refute_in_delta.
537
+ #
538
+ # source://minitest//lib/minitest/assertions.rb#676
539
+ def refute_equal(exp, act, msg = T.unsafe(nil)); end
540
+
541
+ # source://sorbet-result/1.1.0/lib/minitest/result_assertions.rb#44
542
+ def refute_error(exp, result); end
543
+
544
+ # source://sorbet-result/1.1.0/lib/minitest/result_assertions.rb#34
545
+ def refute_failure(result); end
546
+
547
+ # For comparing Floats. Fails if +exp+ is within +delta+ of +act+.
548
+ #
549
+ # refute_in_delta Math::PI, (22.0 / 7.0)
550
+ #
551
+ # source://minitest//lib/minitest/assertions.rb#688
552
+ def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end
553
+
554
+ # For comparing Floats. Fails if +exp+ and +act+ have a relative error
555
+ # less than +epsilon+.
556
+ #
557
+ # source://minitest//lib/minitest/assertions.rb#700
558
+ def refute_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end
559
+
560
+ # Fails if +collection+ includes +obj+.
561
+ #
562
+ # source://minitest//lib/minitest/assertions.rb#707
563
+ def refute_includes(collection, obj, msg = T.unsafe(nil)); end
564
+
565
+ # Fails if +obj+ is an instance of +cls+.
566
+ #
567
+ # source://minitest//lib/minitest/assertions.rb#718
568
+ def refute_instance_of(cls, obj, msg = T.unsafe(nil)); end
569
+
570
+ # Fails if +obj+ is a kind of +cls+.
571
+ #
572
+ # source://minitest//lib/minitest/assertions.rb#728
573
+ def refute_kind_of(cls, obj, msg = T.unsafe(nil)); end
574
+
575
+ # Fails if +matcher+ <tt>=~</tt> +obj+.
576
+ #
577
+ # source://minitest//lib/minitest/assertions.rb#736
578
+ def refute_match(matcher, obj, msg = T.unsafe(nil)); end
579
+
580
+ # Fails if +obj+ is nil.
581
+ #
582
+ # source://minitest//lib/minitest/assertions.rb#746
583
+ def refute_nil(obj, msg = T.unsafe(nil)); end
584
+
585
+ # Fails if +o1+ is not +op+ +o2+. Eg:
586
+ #
587
+ # refute_operator 1, :>, 2 #=> pass
588
+ # refute_operator 1, :<, 2 #=> fail
589
+ #
590
+ # source://minitest//lib/minitest/assertions.rb#781
591
+ def refute_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end
592
+
593
+ # Fails if +path+ exists.
594
+ #
595
+ # source://minitest//lib/minitest/assertions.rb#790
596
+ def refute_path_exists(path, msg = T.unsafe(nil)); end
597
+
598
+ # For testing with pattern matching (only supported with Ruby 3.0 and later)
599
+ #
600
+ # # pass
601
+ # refute_pattern { [1,2,3] => [String] }
602
+ #
603
+ # # fail "NoMatchingPatternError expected, but nothing was raised."
604
+ # refute_pattern { [1,2,3] => [Integer, Integer, Integer] }
605
+ #
606
+ # This assertion expects a NoMatchingPatternError exception, and will fail if none is raised. Any
607
+ # other exceptions will be raised as normal and generate a test error.
608
+ #
609
+ # @raise [NotImplementedError]
610
+ #
611
+ # source://minitest//lib/minitest/assertions.rb#763
612
+ def refute_pattern; end
613
+
614
+ # source://sorbet-result/1.1.0/lib/minitest/result_assertions.rb#39
615
+ def refute_payload(exp, result); end
616
+
617
+ # For testing with predicates.
618
+ #
619
+ # refute_predicate str, :empty?
620
+ #
621
+ # This is really meant for specs and is front-ended by refute_operator:
622
+ #
623
+ # str.wont_be :empty?
624
+ #
625
+ # source://minitest//lib/minitest/assertions.rb#804
626
+ def refute_predicate(o1, op, msg = T.unsafe(nil)); end
627
+
628
+ # Fails if +obj+ responds to the message +meth+.
629
+ # include_all defaults to false to match Object#respond_to?
630
+ #
631
+ # source://minitest//lib/minitest/assertions.rb#813
632
+ def refute_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end
633
+
634
+ # Fails if +exp+ is the same (by object identity) as +act+.
635
+ #
636
+ # source://minitest//lib/minitest/assertions.rb#822
637
+ def refute_same(exp, act, msg = T.unsafe(nil)); end
638
+
639
+ # source://sorbet-result/1.1.0/lib/minitest/result_assertions.rb#29
640
+ def refute_success(result); end
641
+
642
+ # Skips the current run. If run in verbose-mode, the skipped run
643
+ # gets listed at the end of the run but doesn't cause a failure
644
+ # exit code.
645
+ #
646
+ # @raise [Minitest::Skip]
647
+ #
648
+ # source://minitest//lib/minitest/assertions.rb#835
649
+ def skip(msg = T.unsafe(nil), _ignored = T.unsafe(nil)); end
650
+
651
+ # Skips the current run until a given date (in the local time
652
+ # zone). This allows you to put some fixes on hold until a later
653
+ # date, but still holds you accountable and prevents you from
654
+ # forgetting it.
655
+ #
656
+ # source://minitest//lib/minitest/assertions.rb#847
657
+ def skip_until(y, m, d, msg); end
658
+
659
+ # Was this testcase skipped? Meant for #teardown.
660
+ #
661
+ # @return [Boolean]
662
+ #
663
+ # source://minitest//lib/minitest/assertions.rb#856
664
+ def skipped?; end
665
+
666
+ # Returns things to diff [expect, butwas], or [nil, nil] if nothing to diff.
667
+ #
668
+ # Criterion:
669
+ #
670
+ # 1. Strings include newlines or escaped newlines, but not both.
671
+ # 2. or: String lengths are > 30 characters.
672
+ # 3. or: Strings are equal to each other (but maybe different encodings?).
673
+ # 4. and: we found a diff executable.
674
+ #
675
+ # source://minitest//lib/minitest/assertions.rb#104
676
+ def things_to_diff(exp, act); end
677
+
678
+ class << self
679
+ # Returns the diff command to use in #diff. Tries to intelligently
680
+ # figure out what diff to use.
681
+ #
682
+ # source://minitest//lib/minitest/assertions.rb#29
683
+ def diff; end
684
+
685
+ # Set the diff command to use in #diff.
686
+ #
687
+ # source://minitest//lib/minitest/assertions.rb#47
688
+ def diff=(o); end
689
+ end
690
+ end
691
+
692
+ # source://minitest//lib/minitest/assertions.rb#206
693
+ Minitest::Assertions::E = T.let(T.unsafe(nil), String)
694
+
695
+ # source://minitest//lib/minitest/assertions.rb#19
696
+ Minitest::Assertions::UNDEFINED = T.let(T.unsafe(nil), Object)
697
+
698
+ # The standard backtrace filter for minitest.
699
+ #
700
+ # See Minitest.backtrace_filter=.
701
+ #
702
+ # source://minitest//lib/minitest.rb#1108
703
+ class Minitest::BacktraceFilter
704
+ # @return [BacktraceFilter] a new instance of BacktraceFilter
705
+ #
706
+ # source://minitest//lib/minitest.rb#1114
707
+ def initialize(regexp = T.unsafe(nil)); end
708
+
709
+ # Filter +bt+ to something useful. Returns the whole thing if
710
+ # $DEBUG (ruby) or $MT_DEBUG (env).
711
+ #
712
+ # source://minitest//lib/minitest.rb#1122
713
+ def filter(bt); end
714
+
715
+ # Returns the value of attribute regexp.
716
+ #
717
+ # source://minitest//lib/minitest.rb#1112
718
+ def regexp; end
719
+
720
+ # Sets the attribute regexp
721
+ #
722
+ # @param value the value to set the attribute regexp to.
723
+ #
724
+ # source://minitest//lib/minitest.rb#1112
725
+ def regexp=(_arg0); end
726
+ end
727
+
728
+ # source://minitest//lib/minitest.rb#1110
729
+ Minitest::BacktraceFilter::MT_RE = T.let(T.unsafe(nil), Regexp)
730
+
731
+ # Dispatch to multiple reporters as one.
732
+ #
733
+ # source://minitest//lib/minitest.rb#911
734
+ class Minitest::CompositeReporter < ::Minitest::AbstractReporter
735
+ # @return [CompositeReporter] a new instance of CompositeReporter
736
+ #
737
+ # source://minitest//lib/minitest.rb#917
738
+ def initialize(*reporters); end
739
+
740
+ # Add another reporter to the mix.
741
+ #
742
+ # source://minitest//lib/minitest.rb#929
743
+ def <<(reporter); end
744
+
745
+ # source://minitest//lib/minitest.rb#922
746
+ def io; end
747
+
748
+ # @return [Boolean]
749
+ #
750
+ # source://minitest//lib/minitest.rb#933
751
+ def passed?; end
752
+
753
+ # source://minitest//lib/minitest.rb#941
754
+ def prerecord(klass, name); end
755
+
756
+ # source://minitest//lib/minitest.rb#948
757
+ def record(result); end
758
+
759
+ # source://minitest//lib/minitest.rb#954
760
+ def report; end
761
+
762
+ # The list of reporters to dispatch to.
763
+ #
764
+ # source://minitest//lib/minitest.rb#915
765
+ def reporters; end
766
+
767
+ # The list of reporters to dispatch to.
768
+ #
769
+ # source://minitest//lib/minitest.rb#915
770
+ def reporters=(_arg0); end
771
+
772
+ # source://minitest//lib/minitest.rb#937
773
+ def start; end
774
+ end
775
+
776
+ # Compresses backtraces.
777
+ #
778
+ # source://minitest//lib/minitest/compress.rb#5
779
+ module Minitest::Compress
780
+ # Takes a backtrace (array of strings) and compresses repeating
781
+ # cycles in it to make it more readable.
782
+ #
783
+ # source://minitest//lib/minitest/compress.rb#11
784
+ def compress(orig); end
785
+ end
786
+
787
+ # source://minitest//lib/minitest/spec.rb#41
788
+ class Minitest::Expectation < ::Struct
789
+ def ctx; end
790
+ def ctx=(_); end
791
+
792
+ # source://minitest//lib/minitest/spec.rb#25
793
+ def must_be(*args, **_arg1); end
794
+
795
+ # source://minitest//lib/minitest/spec.rb#25
796
+ def must_be_close_to(*args, **_arg1); end
797
+
798
+ # source://minitest//lib/minitest/spec.rb#25
799
+ def must_be_empty(*args, **_arg1); end
800
+
801
+ # source://minitest//lib/minitest/spec.rb#25
802
+ def must_be_instance_of(*args, **_arg1); end
803
+
804
+ # source://minitest//lib/minitest/spec.rb#25
805
+ def must_be_kind_of(*args, **_arg1); end
806
+
807
+ # source://minitest//lib/minitest/spec.rb#25
808
+ def must_be_nil(*args, **_arg1); end
809
+
810
+ # source://minitest//lib/minitest/spec.rb#25
811
+ def must_be_same_as(*args, **_arg1); end
812
+
813
+ # source://minitest//lib/minitest/spec.rb#25
814
+ def must_be_silent(*args, **_arg1); end
815
+
816
+ # source://minitest//lib/minitest/spec.rb#25
817
+ def must_be_within_delta(*args, **_arg1); end
818
+
819
+ # source://minitest//lib/minitest/spec.rb#25
820
+ def must_be_within_epsilon(*args, **_arg1); end
821
+
822
+ # source://minitest//lib/minitest/spec.rb#25
823
+ def must_equal(*args, **_arg1); end
824
+
825
+ # source://minitest//lib/minitest/spec.rb#25
826
+ def must_include(*args, **_arg1); end
827
+
828
+ # source://minitest//lib/minitest/spec.rb#25
829
+ def must_match(*args, **_arg1); end
830
+
831
+ # source://minitest//lib/minitest/spec.rb#25
832
+ def must_output(*args, **_arg1); end
833
+
834
+ # source://minitest//lib/minitest/spec.rb#25
835
+ def must_pattern_match(*args, **_arg1); end
836
+
837
+ # source://minitest//lib/minitest/spec.rb#25
838
+ def must_raise(*args, **_arg1); end
839
+
840
+ # source://minitest//lib/minitest/spec.rb#25
841
+ def must_respond_to(*args, **_arg1); end
842
+
843
+ # source://minitest//lib/minitest/spec.rb#25
844
+ def must_throw(*args, **_arg1); end
845
+
846
+ # source://minitest//lib/minitest/spec.rb#25
847
+ def path_must_exist(*args, **_arg1); end
848
+
849
+ # source://minitest//lib/minitest/spec.rb#25
850
+ def path_wont_exist(*args, **_arg1); end
851
+
852
+ def target; end
853
+ def target=(_); end
854
+
855
+ # source://minitest//lib/minitest/spec.rb#25
856
+ def wont_be(*args, **_arg1); end
857
+
858
+ # source://minitest//lib/minitest/spec.rb#25
859
+ def wont_be_close_to(*args, **_arg1); end
860
+
861
+ # source://minitest//lib/minitest/spec.rb#25
862
+ def wont_be_empty(*args, **_arg1); end
863
+
864
+ # source://minitest//lib/minitest/spec.rb#25
865
+ def wont_be_instance_of(*args, **_arg1); end
866
+
867
+ # source://minitest//lib/minitest/spec.rb#25
868
+ def wont_be_kind_of(*args, **_arg1); end
869
+
870
+ # source://minitest//lib/minitest/spec.rb#25
871
+ def wont_be_nil(*args, **_arg1); end
872
+
873
+ # source://minitest//lib/minitest/spec.rb#25
874
+ def wont_be_same_as(*args, **_arg1); end
875
+
876
+ # source://minitest//lib/minitest/spec.rb#25
877
+ def wont_be_within_delta(*args, **_arg1); end
878
+
879
+ # source://minitest//lib/minitest/spec.rb#25
880
+ def wont_be_within_epsilon(*args, **_arg1); end
881
+
882
+ # source://minitest//lib/minitest/spec.rb#25
883
+ def wont_equal(*args, **_arg1); end
884
+
885
+ # source://minitest//lib/minitest/spec.rb#25
886
+ def wont_include(*args, **_arg1); end
887
+
888
+ # source://minitest//lib/minitest/spec.rb#25
889
+ def wont_match(*args, **_arg1); end
890
+
891
+ # source://minitest//lib/minitest/spec.rb#25
892
+ def wont_pattern_match(*args, **_arg1); end
893
+
894
+ # source://minitest//lib/minitest/spec.rb#25
895
+ def wont_respond_to(*args, **_arg1); end
896
+
897
+ class << self
898
+ def [](*_arg0); end
899
+ def inspect; end
900
+ def keyword_init?; end
901
+ def members; end
902
+ def new(*_arg0); end
903
+ end
904
+ end
905
+
906
+ # It's where you hide your "assertions".
907
+ #
908
+ # Please note, because of the way that expectations are implemented,
909
+ # all expectations (eg must_equal) are dependent upon a thread local
910
+ # variable +:current_spec+. If your specs rely on mixing threads into
911
+ # the specs themselves, you're better off using assertions or the new
912
+ # _(value) wrapper. For example:
913
+ #
914
+ # it "should still work in threads" do
915
+ # my_threaded_thingy do
916
+ # (1+1).must_equal 2 # bad
917
+ # assert_equal 2, 1+1 # good
918
+ # _(1 + 1).must_equal 2 # good
919
+ # value(1 + 1).must_equal 2 # good, also #expect
920
+ # _ { 1 + "1" }.must_raise TypeError # good
921
+ # end
922
+ # end
923
+ #
924
+ # source://minitest//lib/minitest/expectations.rb#20
925
+ module Minitest::Expectations
926
+ # source://minitest//lib/minitest/spec.rb#15
927
+ def must_be(*args, **_arg1); end
928
+
929
+ # source://minitest//lib/minitest/spec.rb#15
930
+ def must_be_close_to(*args, **_arg1); end
931
+
932
+ # source://minitest//lib/minitest/spec.rb#15
933
+ def must_be_empty(*args, **_arg1); end
934
+
935
+ # source://minitest//lib/minitest/spec.rb#15
936
+ def must_be_instance_of(*args, **_arg1); end
937
+
938
+ # source://minitest//lib/minitest/spec.rb#15
939
+ def must_be_kind_of(*args, **_arg1); end
940
+
941
+ # source://minitest//lib/minitest/spec.rb#15
942
+ def must_be_nil(*args, **_arg1); end
943
+
944
+ # source://minitest//lib/minitest/spec.rb#15
945
+ def must_be_same_as(*args, **_arg1); end
946
+
947
+ # source://minitest//lib/minitest/spec.rb#15
948
+ def must_be_silent(*args, **_arg1); end
949
+
950
+ # source://minitest//lib/minitest/spec.rb#15
951
+ def must_be_within_delta(*args, **_arg1); end
952
+
953
+ # source://minitest//lib/minitest/spec.rb#15
954
+ def must_be_within_epsilon(*args, **_arg1); end
955
+
956
+ # source://minitest//lib/minitest/spec.rb#15
957
+ def must_equal(*args, **_arg1); end
958
+
959
+ # source://minitest//lib/minitest/spec.rb#15
960
+ def must_include(*args, **_arg1); end
961
+
962
+ # source://minitest//lib/minitest/spec.rb#15
963
+ def must_match(*args, **_arg1); end
964
+
965
+ # source://minitest//lib/minitest/spec.rb#15
966
+ def must_output(*args, **_arg1); end
967
+
968
+ # source://minitest//lib/minitest/spec.rb#15
969
+ def must_pattern_match(*args, **_arg1); end
970
+
971
+ # source://minitest//lib/minitest/spec.rb#15
972
+ def must_raise(*args, **_arg1); end
973
+
974
+ # source://minitest//lib/minitest/spec.rb#15
975
+ def must_respond_to(*args, **_arg1); end
976
+
977
+ # source://minitest//lib/minitest/spec.rb#15
978
+ def must_throw(*args, **_arg1); end
979
+
980
+ # source://minitest//lib/minitest/spec.rb#15
981
+ def path_must_exist(*args, **_arg1); end
982
+
983
+ # source://minitest//lib/minitest/spec.rb#15
984
+ def path_wont_exist(*args, **_arg1); end
985
+
986
+ # source://minitest//lib/minitest/spec.rb#15
987
+ def wont_be(*args, **_arg1); end
988
+
989
+ # source://minitest//lib/minitest/spec.rb#15
990
+ def wont_be_close_to(*args, **_arg1); end
991
+
992
+ # source://minitest//lib/minitest/spec.rb#15
993
+ def wont_be_empty(*args, **_arg1); end
994
+
995
+ # source://minitest//lib/minitest/spec.rb#15
996
+ def wont_be_instance_of(*args, **_arg1); end
997
+
998
+ # source://minitest//lib/minitest/spec.rb#15
999
+ def wont_be_kind_of(*args, **_arg1); end
1000
+
1001
+ # source://minitest//lib/minitest/spec.rb#15
1002
+ def wont_be_nil(*args, **_arg1); end
1003
+
1004
+ # source://minitest//lib/minitest/spec.rb#15
1005
+ def wont_be_same_as(*args, **_arg1); end
1006
+
1007
+ # source://minitest//lib/minitest/spec.rb#15
1008
+ def wont_be_within_delta(*args, **_arg1); end
1009
+
1010
+ # source://minitest//lib/minitest/spec.rb#15
1011
+ def wont_be_within_epsilon(*args, **_arg1); end
1012
+
1013
+ # source://minitest//lib/minitest/spec.rb#15
1014
+ def wont_equal(*args, **_arg1); end
1015
+
1016
+ # source://minitest//lib/minitest/spec.rb#15
1017
+ def wont_include(*args, **_arg1); end
1018
+
1019
+ # source://minitest//lib/minitest/spec.rb#15
1020
+ def wont_match(*args, **_arg1); end
1021
+
1022
+ # source://minitest//lib/minitest/spec.rb#15
1023
+ def wont_pattern_match(*args, **_arg1); end
1024
+
1025
+ # source://minitest//lib/minitest/spec.rb#15
1026
+ def wont_respond_to(*args, **_arg1); end
1027
+ end
1028
+
1029
+ # Provides a simple set of guards that you can use in your tests
1030
+ # to skip execution if it is not applicable. These methods are
1031
+ # mixed into Test as both instance and class methods so you
1032
+ # can use them inside or outside of the test methods.
1033
+ #
1034
+ # def test_something_for_mri
1035
+ # skip "bug 1234" if jruby?
1036
+ # # ...
1037
+ # end
1038
+ #
1039
+ # if windows? then
1040
+ # # ... lots of test methods ...
1041
+ # end
1042
+ #
1043
+ # source://minitest//lib/minitest.rb#1052
1044
+ module Minitest::Guard
1045
+ # Is this running on jruby?
1046
+ #
1047
+ # @return [Boolean]
1048
+ #
1049
+ # source://minitest//lib/minitest.rb#1057
1050
+ def jruby?(platform = T.unsafe(nil)); end
1051
+
1052
+ # Is this running on maglev?
1053
+ #
1054
+ # @return [Boolean]
1055
+ #
1056
+ # source://minitest//lib/minitest.rb#1064
1057
+ def maglev?(platform = T.unsafe(nil)); end
1058
+
1059
+ # Is this running on mri?
1060
+ #
1061
+ # @return [Boolean]
1062
+ #
1063
+ # source://minitest//lib/minitest.rb#1074
1064
+ def mri?(platform = T.unsafe(nil)); end
1065
+
1066
+ # Is this running on macOS?
1067
+ #
1068
+ # @return [Boolean]
1069
+ #
1070
+ # source://minitest//lib/minitest.rb#1081
1071
+ def osx?(platform = T.unsafe(nil)); end
1072
+
1073
+ # Is this running on rubinius?
1074
+ #
1075
+ # @return [Boolean]
1076
+ #
1077
+ # source://minitest//lib/minitest.rb#1088
1078
+ def rubinius?(platform = T.unsafe(nil)); end
1079
+
1080
+ # Is this running on windows?
1081
+ #
1082
+ # @return [Boolean]
1083
+ #
1084
+ # source://minitest//lib/minitest.rb#1098
1085
+ def windows?(platform = T.unsafe(nil)); end
1086
+ end
1087
+
1088
+ # A simple and clean mock object framework.
1089
+ #
1090
+ # All mock objects are an instance of Mock
1091
+ #
1092
+ # source://minitest//lib/minitest/mock.rb#10
1093
+ class Minitest::Mock
1094
+ # @return [Mock] a new instance of Mock
1095
+ #
1096
+ # source://minitest//lib/minitest/mock.rb#50
1097
+ def initialize(delegator = T.unsafe(nil)); end
1098
+
1099
+ # source://minitest//lib/minitest/mock.rb#33
1100
+ def ===(*args, **kwargs, &b); end
1101
+
1102
+ # source://minitest//lib/minitest/mock.rb#122
1103
+ def __call(name, data); end
1104
+
1105
+ def __respond_to?(*_arg0); end
1106
+
1107
+ # source://minitest//lib/minitest/mock.rb#33
1108
+ def class(*args, **kwargs, &b); end
1109
+
1110
+ # Expect that method +name+ is called, optionally with +args+ (and
1111
+ # +kwargs+ or a +blk+), and returns +retval+.
1112
+ #
1113
+ # @mock.expect(:meaning_of_life, 42)
1114
+ # @mock.meaning_of_life # => 42
1115
+ #
1116
+ # @mock.expect(:do_something_with, true, [some_obj, true])
1117
+ # @mock.do_something_with(some_obj, true) # => true
1118
+ #
1119
+ # @mock.expect(:do_something_else, true) do |a1, a2|
1120
+ # a1 == "buggs" && a2 == :bunny
1121
+ # end
1122
+ #
1123
+ # +args+ is compared to the expected args using case equality (ie, the
1124
+ # '===' operator), allowing for less specific expectations.
1125
+ #
1126
+ # @mock.expect(:uses_any_string, true, [String])
1127
+ # @mock.uses_any_string("foo") # => true
1128
+ # @mock.verify # => true
1129
+ #
1130
+ # @mock.expect(:uses_one_string, true, ["foo"])
1131
+ # @mock.uses_one_string("bar") # => raises MockExpectationError
1132
+ #
1133
+ # If a method will be called multiple times, specify a new expect for each one.
1134
+ # They will be used in the order you define them.
1135
+ #
1136
+ # @mock.expect(:ordinal_increment, 'first')
1137
+ # @mock.expect(:ordinal_increment, 'second')
1138
+ #
1139
+ # @mock.ordinal_increment # => 'first'
1140
+ # @mock.ordinal_increment # => 'second'
1141
+ # @mock.ordinal_increment # => raises MockExpectationError "No more expects available for :ordinal_increment"
1142
+ #
1143
+ # source://minitest//lib/minitest/mock.rb#93
1144
+ def expect(name, retval, args = T.unsafe(nil), **kwargs, &blk); end
1145
+
1146
+ # source://minitest//lib/minitest/mock.rb#33
1147
+ def inspect(*args, **kwargs, &b); end
1148
+
1149
+ # source://minitest//lib/minitest/mock.rb#33
1150
+ def instance_eval(*args, **kwargs, &b); end
1151
+
1152
+ # source://minitest//lib/minitest/mock.rb#33
1153
+ def instance_variables(*args, **kwargs, &b); end
1154
+
1155
+ # source://minitest//lib/minitest/mock.rb#152
1156
+ def method_missing(sym, *args, **kwargs, &block); end
1157
+
1158
+ # source://minitest//lib/minitest/mock.rb#33
1159
+ def object_id(*args, **kwargs, &b); end
1160
+
1161
+ # source://minitest//lib/minitest/mock.rb#33
1162
+ def public_send(*args, **kwargs, &b); end
1163
+
1164
+ # @return [Boolean]
1165
+ #
1166
+ # source://minitest//lib/minitest/mock.rb#238
1167
+ def respond_to?(sym, include_private = T.unsafe(nil)); end
1168
+
1169
+ # source://minitest//lib/minitest/mock.rb#33
1170
+ def send(*args, **kwargs, &b); end
1171
+
1172
+ # source://minitest//lib/minitest/mock.rb#33
1173
+ def to_s(*args, **kwargs, &b); end
1174
+
1175
+ # Verify that all methods were called as expected. Raises
1176
+ # +MockExpectationError+ if the mock object was not called as
1177
+ # expected.
1178
+ #
1179
+ # source://minitest//lib/minitest/mock.rb#142
1180
+ def verify; end
1181
+
1182
+ private
1183
+
1184
+ # source://minitest//lib/minitest/mock.rb#33
1185
+ def respond_to_missing?(*args, **kwargs, &b); end
1186
+ end
1187
+
1188
+ # source://minitest//lib/minitest/parallel.rb#2
1189
+ module Minitest::Parallel; end
1190
+
1191
+ # The engine used to run multiple tests in parallel.
1192
+ #
1193
+ # source://minitest//lib/minitest/parallel.rb#7
1194
+ class Minitest::Parallel::Executor
1195
+ # Create a parallel test executor of with +size+ workers.
1196
+ #
1197
+ # @return [Executor] a new instance of Executor
1198
+ #
1199
+ # source://minitest//lib/minitest/parallel.rb#17
1200
+ def initialize(size); end
1201
+
1202
+ # Add a job to the queue
1203
+ #
1204
+ # source://minitest//lib/minitest/parallel.rb#43
1205
+ def <<(work); end
1206
+
1207
+ # Shuts down the pool of workers by signalling them to quit and
1208
+ # waiting for them all to finish what they're currently working
1209
+ # on.
1210
+ #
1211
+ # source://minitest//lib/minitest/parallel.rb#50
1212
+ def shutdown; end
1213
+
1214
+ # The size of the pool of workers.
1215
+ #
1216
+ # source://minitest//lib/minitest/parallel.rb#12
1217
+ def size; end
1218
+
1219
+ # Start the executor
1220
+ #
1221
+ # source://minitest//lib/minitest/parallel.rb#26
1222
+ def start; end
1223
+ end
1224
+
1225
+ # source://minitest//lib/minitest/parallel.rb#56
1226
+ module Minitest::Parallel::Test
1227
+ # source://minitest//lib/minitest/parallel.rb#57
1228
+ def _synchronize; end
1229
+ end
1230
+
1231
+ # source://minitest//lib/minitest/parallel.rb#59
1232
+ module Minitest::Parallel::Test::ClassMethods
1233
+ # source://minitest//lib/minitest/parallel.rb#60
1234
+ def run_one_method(klass, method_name, reporter); end
1235
+
1236
+ # source://minitest//lib/minitest/parallel.rb#64
1237
+ def test_order; end
1238
+ end
1239
+
1240
+ # A very simple reporter that prints the "dots" during 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
+ # source://minitest//lib/minitest.rb#710
1248
+ class Minitest::ProgressReporter < ::Minitest::Reporter
1249
+ # source://minitest//lib/minitest.rb#711
1250
+ def prerecord(klass, name); end
1251
+
1252
+ # source://minitest//lib/minitest.rb#718
1253
+ def record(result); end
1254
+ end
1255
+
1256
+ # Shared code for anything that can get passed to a Reporter. See
1257
+ # Minitest::Test & Minitest::Result.
1258
+ #
1259
+ # source://minitest//lib/minitest.rb#532
1260
+ module Minitest::Reportable
1261
+ # @raise [NotImplementedError]
1262
+ #
1263
+ # source://minitest//lib/minitest.rb#554
1264
+ def class_name; end
1265
+
1266
+ # Did this run error?
1267
+ #
1268
+ # @return [Boolean]
1269
+ #
1270
+ # source://minitest//lib/minitest.rb#575
1271
+ def error?; end
1272
+
1273
+ # The location identifier of this test. Depends on a method
1274
+ # existing called class_name.
1275
+ #
1276
+ # source://minitest//lib/minitest.rb#549
1277
+ def location; end
1278
+
1279
+ # Did this run pass?
1280
+ #
1281
+ # Note: skipped runs are not considered passing, but they don't
1282
+ # cause the process to exit non-zero.
1283
+ #
1284
+ # @return [Boolean]
1285
+ #
1286
+ # source://minitest//lib/minitest.rb#539
1287
+ def passed?; end
1288
+
1289
+ # Returns ".", "F", or "E" based on the result of the run.
1290
+ #
1291
+ # source://minitest//lib/minitest.rb#561
1292
+ def result_code; end
1293
+
1294
+ # Was this run skipped?
1295
+ #
1296
+ # @return [Boolean]
1297
+ #
1298
+ # source://minitest//lib/minitest.rb#568
1299
+ def skipped?; end
1300
+ end
1301
+
1302
+ # source://minitest//lib/minitest.rb#543
1303
+ Minitest::Reportable::BASE_DIR = T.let(T.unsafe(nil), String)
1304
+
1305
+ # source://minitest//lib/minitest.rb#686
1306
+ class Minitest::Reporter < ::Minitest::AbstractReporter
1307
+ # @return [Reporter] a new instance of Reporter
1308
+ #
1309
+ # source://minitest//lib/minitest.rb#695
1310
+ def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end
1311
+
1312
+ # The IO used to report.
1313
+ #
1314
+ # source://minitest//lib/minitest.rb#688
1315
+ def io; end
1316
+
1317
+ # The IO used to report.
1318
+ #
1319
+ # source://minitest//lib/minitest.rb#688
1320
+ def io=(_arg0); end
1321
+
1322
+ # Command-line options for this run.
1323
+ #
1324
+ # source://minitest//lib/minitest.rb#693
1325
+ def options; end
1326
+
1327
+ # Command-line options for this run.
1328
+ #
1329
+ # source://minitest//lib/minitest.rb#693
1330
+ def options=(_arg0); end
1331
+ end
1332
+
1333
+ # This represents a test result in a clean way that can be
1334
+ # marshalled over a wire. Tests can do anything they want to the
1335
+ # test instance and can create conditions that cause Marshal.dump to
1336
+ # blow up. By using Result.from(a_test) you can be reasonably sure
1337
+ # that the test result can be marshalled.
1338
+ #
1339
+ # source://minitest//lib/minitest.rb#587
1340
+ class Minitest::Result < ::Minitest::Runnable
1341
+ include ::Minitest::Reportable
1342
+
1343
+ # source://minitest//lib/minitest.rb#621
1344
+ def class_name; end
1345
+
1346
+ # The class name of the test result.
1347
+ #
1348
+ # source://minitest//lib/minitest.rb#596
1349
+ def klass; end
1350
+
1351
+ # The class name of the test result.
1352
+ #
1353
+ # source://minitest//lib/minitest.rb#596
1354
+ def klass=(_arg0); end
1355
+
1356
+ # The location of the test method.
1357
+ #
1358
+ # source://minitest//lib/minitest.rb#601
1359
+ def source_location; end
1360
+
1361
+ # The location of the test method.
1362
+ #
1363
+ # source://minitest//lib/minitest.rb#601
1364
+ def source_location=(_arg0); end
1365
+
1366
+ # source://minitest//lib/minitest.rb#625
1367
+ def to_s; end
1368
+
1369
+ class << self
1370
+ # Create a new test result from a Runnable instance.
1371
+ #
1372
+ # source://minitest//lib/minitest.rb#606
1373
+ def from(runnable); end
1374
+ end
1375
+ end
1376
+
1377
+ # re-open
1378
+ #
1379
+ # source://minitest//lib/minitest.rb#305
1380
+ class Minitest::Runnable
1381
+ # @return [Runnable] a new instance of Runnable
1382
+ #
1383
+ # source://minitest//lib/minitest.rb#463
1384
+ def initialize(name); end
1385
+
1386
+ # Number of assertions executed in this run.
1387
+ #
1388
+ # source://minitest//lib/minitest.rb#309
1389
+ def assertions; end
1390
+
1391
+ # Number of assertions executed in this run.
1392
+ #
1393
+ # source://minitest//lib/minitest.rb#309
1394
+ def assertions=(_arg0); end
1395
+
1396
+ # source://minitest//lib/minitest.rb#459
1397
+ def failure; end
1398
+
1399
+ # An assertion raised during the run, if any.
1400
+ #
1401
+ # source://minitest//lib/minitest.rb#314
1402
+ def failures; end
1403
+
1404
+ # An assertion raised during the run, if any.
1405
+ #
1406
+ # source://minitest//lib/minitest.rb#314
1407
+ def failures=(_arg0); end
1408
+
1409
+ # source://minitest//lib/minitest.rb#445
1410
+ def marshal_dump; end
1411
+
1412
+ # source://minitest//lib/minitest.rb#455
1413
+ def marshal_load(ary); end
1414
+
1415
+ # Metadata you attach to the test results that get sent to the reporter.
1416
+ #
1417
+ # Lazily initializes to a hash, to keep memory down.
1418
+ #
1419
+ # NOTE: this data *must* be plain (read: marshal-able) data!
1420
+ # Hashes! Arrays! Strings!
1421
+ #
1422
+ # source://minitest//lib/minitest.rb#478
1423
+ def metadata; end
1424
+
1425
+ # Sets metadata, mainly used for +Result.from+.
1426
+ #
1427
+ # source://minitest//lib/minitest.rb#485
1428
+ def metadata=(_arg0); end
1429
+
1430
+ # Returns true if metadata exists.
1431
+ #
1432
+ # @return [Boolean]
1433
+ #
1434
+ # source://minitest//lib/minitest.rb#490
1435
+ def metadata?; end
1436
+
1437
+ # Name of the run.
1438
+ #
1439
+ # source://minitest//lib/minitest.rb#332
1440
+ def name; end
1441
+
1442
+ # Set the name of the run.
1443
+ #
1444
+ # source://minitest//lib/minitest.rb#339
1445
+ def name=(o); end
1446
+
1447
+ # Did this run pass?
1448
+ #
1449
+ # Note: skipped runs are not considered passing, but they don't
1450
+ # cause the process to exit non-zero.
1451
+ #
1452
+ # @raise [NotImplementedError]
1453
+ # @return [Boolean]
1454
+ #
1455
+ # source://minitest//lib/minitest.rb#507
1456
+ def passed?; end
1457
+
1458
+ # Returns a single character string to print based on the result
1459
+ # of the run. One of <tt>"."</tt>, <tt>"F"</tt>,
1460
+ # <tt>"E"</tt> or <tt>"S"</tt>.
1461
+ #
1462
+ # @raise [NotImplementedError]
1463
+ #
1464
+ # source://minitest//lib/minitest.rb#516
1465
+ def result_code; end
1466
+
1467
+ # Runs a single method. Needs to return self.
1468
+ #
1469
+ # @raise [NotImplementedError]
1470
+ #
1471
+ # source://minitest//lib/minitest.rb#497
1472
+ def run; end
1473
+
1474
+ # Was this run skipped? See #passed? for more information.
1475
+ #
1476
+ # @raise [NotImplementedError]
1477
+ # @return [Boolean]
1478
+ #
1479
+ # source://minitest//lib/minitest.rb#523
1480
+ def skipped?; end
1481
+
1482
+ # The time it took to run.
1483
+ #
1484
+ # source://minitest//lib/minitest.rb#319
1485
+ def time; end
1486
+
1487
+ # The time it took to run.
1488
+ #
1489
+ # source://minitest//lib/minitest.rb#319
1490
+ def time=(_arg0); end
1491
+
1492
+ # source://minitest//lib/minitest.rb#321
1493
+ def time_it; end
1494
+
1495
+ class << self
1496
+ # source://minitest//lib/minitest.rb#1156
1497
+ def inherited(klass); end
1498
+
1499
+ # Returns all instance methods matching the pattern +re+.
1500
+ #
1501
+ # source://minitest//lib/minitest.rb#346
1502
+ def methods_matching(re); end
1503
+
1504
+ # source://minitest//lib/minitest.rb#415
1505
+ def on_signal(name, action); end
1506
+
1507
+ # source://minitest//lib/minitest.rb#350
1508
+ def reset; end
1509
+
1510
+ # Responsible for running all runnable methods in a given class,
1511
+ # each in its own instance. Each instance is passed to the
1512
+ # reporter to record.
1513
+ #
1514
+ # source://minitest//lib/minitest.rb#361
1515
+ def run(reporter, options = T.unsafe(nil)); end
1516
+
1517
+ # Runs a single method and has the reporter record the result.
1518
+ # This was considered internal API but is factored out of run so
1519
+ # that subclasses can specialize the running of an individual
1520
+ # test. See Minitest::ParallelTest::ClassMethods for an example.
1521
+ #
1522
+ # source://minitest//lib/minitest.rb#387
1523
+ def run_one_method(klass, method_name, reporter); end
1524
+
1525
+ # Each subclass of Runnable is responsible for overriding this
1526
+ # method to return all runnable methods. See #methods_matching.
1527
+ #
1528
+ # @raise [NotImplementedError]
1529
+ #
1530
+ # source://minitest//lib/minitest.rb#432
1531
+ def runnable_methods; end
1532
+
1533
+ # Returns all subclasses of Runnable.
1534
+ #
1535
+ # source://minitest//lib/minitest.rb#439
1536
+ def runnables; end
1537
+
1538
+ # Defines the order to run tests (:random by default). Override
1539
+ # this or use a convenience method to change it for your tests.
1540
+ #
1541
+ # source://minitest//lib/minitest.rb#396
1542
+ def test_order; end
1543
+
1544
+ # source://minitest//lib/minitest.rb#400
1545
+ def with_info_handler(reporter, &block); end
1546
+ end
1547
+ end
1548
+
1549
+ # source://minitest//lib/minitest.rb#413
1550
+ Minitest::Runnable::SIGNALS = T.let(T.unsafe(nil), Hash)
1551
+
1552
+ # Assertion raised when skipping a run.
1553
+ #
1554
+ # source://minitest//lib/minitest.rb#992
1555
+ class Minitest::Skip < ::Minitest::Assertion
1556
+ # source://minitest//lib/minitest.rb#993
1557
+ def result_label; end
1558
+ end
1559
+
1560
+ # Minitest::Spec -- The faster, better, less-magical spec framework!
1561
+ #
1562
+ # For a list of expectations, see Minitest::Expectations.
1563
+ #
1564
+ # source://minitest//lib/minitest/spec.rb#106
1565
+ class Minitest::Spec < ::Minitest::Test
1566
+ include ::Minitest::Spec::DSL::InstanceMethods
1567
+ extend ::Minitest::Spec::DSL
1568
+
1569
+ # @return [Spec] a new instance of Spec
1570
+ #
1571
+ # source://minitest//lib/minitest/spec.rb#112
1572
+ def initialize(name); end
1573
+
1574
+ class << self
1575
+ # source://minitest//lib/minitest/spec.rb#108
1576
+ def current; end
1577
+ end
1578
+ end
1579
+
1580
+ # Oh look! A Minitest::Spec::DSL module! Eat your heart out DHH.
1581
+ #
1582
+ # source://minitest//lib/minitest/spec.rb#120
1583
+ module Minitest::Spec::DSL
1584
+ # Define an 'after' action. Inherits the way normal methods should.
1585
+ #
1586
+ # NOTE: +type+ is ignored and is only there to make porting easier.
1587
+ #
1588
+ # Equivalent to Minitest::Test#teardown.
1589
+ #
1590
+ # source://minitest//lib/minitest/spec.rb#205
1591
+ def after(_type = T.unsafe(nil), &block); end
1592
+
1593
+ # Define a 'before' action. Inherits the way normal methods should.
1594
+ #
1595
+ # NOTE: +type+ is ignored and is only there to make porting easier.
1596
+ #
1597
+ # Equivalent to Minitest::Test#setup.
1598
+ #
1599
+ # source://minitest//lib/minitest/spec.rb#191
1600
+ def before(_type = T.unsafe(nil), &block); end
1601
+
1602
+ # source://minitest//lib/minitest/spec.rb#174
1603
+ def children; end
1604
+
1605
+ # source://minitest//lib/minitest/spec.rb#270
1606
+ def create(name, desc); end
1607
+
1608
+ # source://minitest//lib/minitest/spec.rb#291
1609
+ def desc; end
1610
+
1611
+ # source://minitest//lib/minitest/spec.rb#170
1612
+ def describe_stack; end
1613
+
1614
+ # Define an expectation with name +desc+. Name gets morphed to a
1615
+ # proper test method name. For some freakish reason, people who
1616
+ # write specs don't like class inheritance, so this goes way out of
1617
+ # its way to make sure that expectations aren't inherited.
1618
+ #
1619
+ # This is also aliased to #specify and doesn't require a +desc+ arg.
1620
+ #
1621
+ # Hint: If you _do_ want inheritance, use minitest/test. You can mix
1622
+ # and match between assertions and expectations as much as you want.
1623
+ #
1624
+ # source://minitest//lib/minitest/spec.rb#223
1625
+ def it(desc = T.unsafe(nil), &block); end
1626
+
1627
+ # Essentially, define an accessor for +name+ with +block+.
1628
+ #
1629
+ # Why use let instead of def? I honestly don't know.
1630
+ #
1631
+ # @raise [ArgumentError]
1632
+ #
1633
+ # source://minitest//lib/minitest/spec.rb#247
1634
+ def let(name, &block); end
1635
+
1636
+ # source://minitest//lib/minitest/spec.rb#283
1637
+ def name; end
1638
+
1639
+ # source://minitest//lib/minitest/spec.rb#178
1640
+ def nuke_test_methods!; end
1641
+
1642
+ # Register a new type of spec that matches the spec's description.
1643
+ # This method can take either a Regexp and a spec class or a spec
1644
+ # class and a block that takes the description and returns true if
1645
+ # it matches.
1646
+ #
1647
+ # Eg:
1648
+ #
1649
+ # register_spec_type(/Controller$/, Minitest::Spec::Rails)
1650
+ #
1651
+ # or:
1652
+ #
1653
+ # register_spec_type(Minitest::Spec::RailsModel) do |desc|
1654
+ # desc.superclass == ActiveRecord::Base
1655
+ # end
1656
+ #
1657
+ # source://minitest//lib/minitest/spec.rb#146
1658
+ def register_spec_type(*args, &block); end
1659
+
1660
+ # Figure out the spec class to use based on a spec's description. Eg:
1661
+ #
1662
+ # spec_type("BlahController") # => Minitest::Spec::Rails
1663
+ #
1664
+ # source://minitest//lib/minitest/spec.rb#160
1665
+ def spec_type(desc, *additional); end
1666
+
1667
+ # Define an expectation with name +desc+. Name gets morphed to a
1668
+ # proper test method name. For some freakish reason, people who
1669
+ # write specs don't like class inheritance, so this goes way out of
1670
+ # its way to make sure that expectations aren't inherited.
1671
+ #
1672
+ # This is also aliased to #specify and doesn't require a +desc+ arg.
1673
+ #
1674
+ # Hint: If you _do_ want inheritance, use minitest/test. You can mix
1675
+ # and match between assertions and expectations as much as you want.
1676
+ #
1677
+ # source://minitest//lib/minitest/spec.rb#223
1678
+ def specify(desc = T.unsafe(nil), &block); end
1679
+
1680
+ # Another lazy man's accessor generator. Made even more lazy by
1681
+ # setting the name for you to +subject+.
1682
+ #
1683
+ # source://minitest//lib/minitest/spec.rb#266
1684
+ def subject(&block); end
1685
+
1686
+ # source://minitest//lib/minitest/spec.rb#287
1687
+ def to_s; end
1688
+
1689
+ class << self
1690
+ # source://minitest//lib/minitest/spec.rb#335
1691
+ def extended(obj); end
1692
+ end
1693
+ end
1694
+
1695
+ # Rdoc... why are you so dumb?
1696
+ #
1697
+ # source://minitest//lib/minitest/spec.rb#297
1698
+ module Minitest::Spec::DSL::InstanceMethods
1699
+ # Takes a value or a block and returns a value monad that has
1700
+ # all of Expectations methods available to it.
1701
+ #
1702
+ # _(1 + 1).must_equal 2
1703
+ #
1704
+ # And for blocks:
1705
+ #
1706
+ # _ { 1 + "1" }.must_raise TypeError
1707
+ #
1708
+ # This method of expectation-based testing is preferable to
1709
+ # straight-expectation methods (on Object) because it stores its
1710
+ # test context, bypassing our hacky use of thread-local variables.
1711
+ #
1712
+ # NOTE: At some point, the methods on Object will be deprecated
1713
+ # and then removed.
1714
+ #
1715
+ # It is also aliased to #value and #expect for your aesthetic
1716
+ # pleasure:
1717
+ #
1718
+ # _(1 + 1).must_equal 2
1719
+ # value(1 + 1).must_equal 2
1720
+ # expect(1 + 1).must_equal 2
1721
+ #
1722
+ # source://minitest//lib/minitest/spec.rb#322
1723
+ def _(value = T.unsafe(nil), &block); end
1724
+
1725
+ # source://minitest//lib/minitest/spec.rb#329
1726
+ def before_setup; end
1727
+
1728
+ # Takes a value or a block and returns a value monad that has
1729
+ # all of Expectations methods available to it.
1730
+ #
1731
+ # _(1 + 1).must_equal 2
1732
+ #
1733
+ # And for blocks:
1734
+ #
1735
+ # _ { 1 + "1" }.must_raise TypeError
1736
+ #
1737
+ # This method of expectation-based testing is preferable to
1738
+ # straight-expectation methods (on Object) because it stores its
1739
+ # test context, bypassing our hacky use of thread-local variables.
1740
+ #
1741
+ # NOTE: At some point, the methods on Object will be deprecated
1742
+ # and then removed.
1743
+ #
1744
+ # It is also aliased to #value and #expect for your aesthetic
1745
+ # pleasure:
1746
+ #
1747
+ # _(1 + 1).must_equal 2
1748
+ # value(1 + 1).must_equal 2
1749
+ # expect(1 + 1).must_equal 2
1750
+ #
1751
+ # source://minitest//lib/minitest/spec.rb#322
1752
+ def expect(value = T.unsafe(nil), &block); end
1753
+
1754
+ # Takes a value or a block and returns a value monad that has
1755
+ # all of Expectations methods available to it.
1756
+ #
1757
+ # _(1 + 1).must_equal 2
1758
+ #
1759
+ # And for blocks:
1760
+ #
1761
+ # _ { 1 + "1" }.must_raise TypeError
1762
+ #
1763
+ # This method of expectation-based testing is preferable to
1764
+ # straight-expectation methods (on Object) because it stores its
1765
+ # test context, bypassing our hacky use of thread-local variables.
1766
+ #
1767
+ # NOTE: At some point, the methods on Object will be deprecated
1768
+ # and then removed.
1769
+ #
1770
+ # It is also aliased to #value and #expect for your aesthetic
1771
+ # pleasure:
1772
+ #
1773
+ # _(1 + 1).must_equal 2
1774
+ # value(1 + 1).must_equal 2
1775
+ # expect(1 + 1).must_equal 2
1776
+ #
1777
+ # source://minitest//lib/minitest/spec.rb#322
1778
+ def value(value = T.unsafe(nil), &block); end
1779
+ end
1780
+
1781
+ # Contains pairs of matchers and Spec classes to be used to
1782
+ # calculate the superclass of a top-level describe. This allows for
1783
+ # automatically customizable spec types.
1784
+ #
1785
+ # See: register_spec_type and spec_type
1786
+ #
1787
+ # source://minitest//lib/minitest/spec.rb#128
1788
+ Minitest::Spec::DSL::TYPES = T.let(T.unsafe(nil), Array)
1789
+
1790
+ # source://minitest//lib/minitest/spec.rb#342
1791
+ Minitest::Spec::TYPES = T.let(T.unsafe(nil), Array)
1792
+
1793
+ # A reporter that gathers statistics about a test run. Does not do
1794
+ # any IO because meant to be used as a parent class for a reporter
1795
+ # that does.
1796
+ #
1797
+ # If you want to create an entirely different type of output (eg,
1798
+ # CI, HTML, etc), this is the place to start.
1799
+ #
1800
+ # Example:
1801
+ #
1802
+ # class JenkinsCIReporter < StatisticsReporter
1803
+ # def report
1804
+ # super # Needed to calculate some statistics
1805
+ #
1806
+ # print "<testsuite "
1807
+ # print "tests='#{count}' "
1808
+ # print "failures='#{failures}' "
1809
+ # # Remaining XML...
1810
+ # end
1811
+ # end
1812
+ #
1813
+ # source://minitest//lib/minitest.rb#746
1814
+ class Minitest::StatisticsReporter < ::Minitest::Reporter
1815
+ # @return [StatisticsReporter] a new instance of StatisticsReporter
1816
+ #
1817
+ # source://minitest//lib/minitest.rb#790
1818
+ def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end
1819
+
1820
+ # Total number of assertions.
1821
+ #
1822
+ # source://minitest//lib/minitest.rb#750
1823
+ def assertions; end
1824
+
1825
+ # Total number of assertions.
1826
+ #
1827
+ # source://minitest//lib/minitest.rb#750
1828
+ def assertions=(_arg0); end
1829
+
1830
+ # Total number of test cases.
1831
+ #
1832
+ # source://minitest//lib/minitest.rb#755
1833
+ def count; end
1834
+
1835
+ # Total number of test cases.
1836
+ #
1837
+ # source://minitest//lib/minitest.rb#755
1838
+ def count=(_arg0); end
1839
+
1840
+ # Total number of tests that erred.
1841
+ #
1842
+ # source://minitest//lib/minitest.rb#783
1843
+ def errors; end
1844
+
1845
+ # Total number of tests that erred.
1846
+ #
1847
+ # source://minitest//lib/minitest.rb#783
1848
+ def errors=(_arg0); end
1849
+
1850
+ # Total number of tests that failed.
1851
+ #
1852
+ # source://minitest//lib/minitest.rb#778
1853
+ def failures; end
1854
+
1855
+ # Total number of tests that failed.
1856
+ #
1857
+ # source://minitest//lib/minitest.rb#778
1858
+ def failures=(_arg0); end
1859
+
1860
+ # @return [Boolean]
1861
+ #
1862
+ # source://minitest//lib/minitest.rb#803
1863
+ def passed?; end
1864
+
1865
+ # source://minitest//lib/minitest.rb#811
1866
+ def record(result); end
1867
+
1868
+ # Report on the tracked statistics.
1869
+ #
1870
+ # source://minitest//lib/minitest.rb#821
1871
+ def report; end
1872
+
1873
+ # An +Array+ of test cases that failed or were skipped.
1874
+ #
1875
+ # source://minitest//lib/minitest.rb#760
1876
+ def results; end
1877
+
1878
+ # An +Array+ of test cases that failed or were skipped.
1879
+ #
1880
+ # source://minitest//lib/minitest.rb#760
1881
+ def results=(_arg0); end
1882
+
1883
+ # Total number of tests that where skipped.
1884
+ #
1885
+ # source://minitest//lib/minitest.rb#788
1886
+ def skips; end
1887
+
1888
+ # Total number of tests that where skipped.
1889
+ #
1890
+ # source://minitest//lib/minitest.rb#788
1891
+ def skips=(_arg0); end
1892
+
1893
+ # source://minitest//lib/minitest.rb#807
1894
+ def start; end
1895
+
1896
+ # Time the test run started. If available, the monotonic clock is
1897
+ # used and this is a +Float+, otherwise it's an instance of
1898
+ # +Time+.
1899
+ #
1900
+ # source://minitest//lib/minitest.rb#767
1901
+ def start_time; end
1902
+
1903
+ # Time the test run started. If available, the monotonic clock is
1904
+ # used and this is a +Float+, otherwise it's an instance of
1905
+ # +Time+.
1906
+ #
1907
+ # source://minitest//lib/minitest.rb#767
1908
+ def start_time=(_arg0); end
1909
+
1910
+ # Test run time. If available, the monotonic clock is used and
1911
+ # this is a +Float+, otherwise it's an instance of +Time+.
1912
+ #
1913
+ # source://minitest//lib/minitest.rb#773
1914
+ def total_time; end
1915
+
1916
+ # Test run time. If available, the monotonic clock is used and
1917
+ # this is a +Float+, otherwise it's an instance of +Time+.
1918
+ #
1919
+ # source://minitest//lib/minitest.rb#773
1920
+ def total_time=(_arg0); end
1921
+ end
1922
+
1923
+ # A reporter that prints the header, summary, and failure details at
1924
+ # the end of the run.
1925
+ #
1926
+ # This is added to the top-level CompositeReporter at the start of
1927
+ # the run. If you want to change the output of minitest via a
1928
+ # plugin, pull this out of the composite and replace it with your
1929
+ # own.
1930
+ #
1931
+ # source://minitest//lib/minitest.rb#841
1932
+ class Minitest::SummaryReporter < ::Minitest::StatisticsReporter
1933
+ # source://minitest//lib/minitest.rb#876
1934
+ def aggregated_results(io); end
1935
+
1936
+ # Returns the value of attribute old_sync.
1937
+ #
1938
+ # source://minitest//lib/minitest.rb#844
1939
+ def old_sync; end
1940
+
1941
+ # Sets the attribute old_sync
1942
+ #
1943
+ # @param value the value to set the attribute old_sync to.
1944
+ #
1945
+ # source://minitest//lib/minitest.rb#844
1946
+ def old_sync=(_arg0); end
1947
+
1948
+ # source://minitest//lib/minitest.rb#859
1949
+ def report; end
1950
+
1951
+ # :startdoc:
1952
+ #
1953
+ # source://minitest//lib/minitest.rb#847
1954
+ def start; end
1955
+
1956
+ # source://minitest//lib/minitest.rb#871
1957
+ def statistics; end
1958
+
1959
+ # source://minitest//lib/minitest.rb#896
1960
+ def summary; end
1961
+
1962
+ # :stopdoc:
1963
+ #
1964
+ # source://minitest//lib/minitest.rb#843
1965
+ def sync; end
1966
+
1967
+ # :stopdoc:
1968
+ #
1969
+ # source://minitest//lib/minitest.rb#843
1970
+ def sync=(_arg0); end
1971
+
1972
+ # source://minitest//lib/minitest.rb#892
1973
+ def to_s; end
1974
+ end
1975
+
1976
+ # Subclass Test to create your own tests. Typically you'll want a
1977
+ # Test subclass per implementation class.
1978
+ #
1979
+ # See Minitest::Assertions
1980
+ #
1981
+ # source://minitest//lib/minitest/test.rb#10
1982
+ class Minitest::Test < ::Minitest::Runnable
1983
+ include ::Minitest::Assertions
1984
+ include ::Minitest::Reportable
1985
+ include ::Minitest::Test::LifecycleHooks
1986
+ include ::Minitest::Guard
1987
+ extend ::Minitest::Guard
1988
+
1989
+ # LifecycleHooks
1990
+ #
1991
+ # source://minitest//lib/minitest/test.rb#190
1992
+ def capture_exceptions; end
1993
+
1994
+ # source://minitest//lib/minitest/test.rb#15
1995
+ def class_name; end
1996
+
1997
+ # source://minitest//lib/minitest/test.rb#207
1998
+ def neuter_exception(e); end
1999
+
2000
+ # source://minitest//lib/minitest/test.rb#218
2001
+ def new_exception(klass, msg, bt, kill = T.unsafe(nil)); end
2002
+
2003
+ # Runs a single test with setup/teardown hooks.
2004
+ #
2005
+ # source://minitest//lib/minitest/test.rb#86
2006
+ def run; end
2007
+
2008
+ # source://minitest//lib/minitest/test.rb#200
2009
+ def sanitize_exception(e); end
2010
+
2011
+ # source://minitest//lib/minitest/test.rb#232
2012
+ def with_info_handler(&block); end
2013
+
2014
+ class << self
2015
+ # source://minitest-focus/1.4.0/lib/minitest/focus.rb#10
2016
+ def add_to_filter(name); end
2017
+
2018
+ # source://minitest-focus/1.4.0/lib/minitest/focus.rb#14
2019
+ def filtered_names; end
2020
+
2021
+ # source://minitest-focus/1.4.0/lib/minitest/focus.rb#40
2022
+ def focus(name = T.unsafe(nil)); end
2023
+
2024
+ # Call this at the top of your tests when you absolutely
2025
+ # positively need to have ordered tests. In doing so, you're
2026
+ # admitting that you suck and your tests are weak.
2027
+ #
2028
+ # source://minitest//lib/minitest/test.rb#35
2029
+ def i_suck_and_my_tests_are_order_dependent!; end
2030
+
2031
+ # Returns the value of attribute io_lock.
2032
+ #
2033
+ # source://minitest//lib/minitest/test.rb#26
2034
+ def io_lock; end
2035
+
2036
+ # Sets the attribute io_lock
2037
+ #
2038
+ # @param value the value to set the attribute io_lock to.
2039
+ #
2040
+ # source://minitest//lib/minitest/test.rb#26
2041
+ def io_lock=(_arg0); end
2042
+
2043
+ # Make diffs for this Test use #pretty_inspect so that diff
2044
+ # in assert_equal can have more details. NOTE: this is much slower
2045
+ # than the regular inspect but much more usable for complex
2046
+ # objects.
2047
+ #
2048
+ # source://minitest//lib/minitest/test.rb#48
2049
+ def make_my_diffs_pretty!; end
2050
+
2051
+ # Call this at the top of your tests when you want to run your
2052
+ # tests in parallel. In doing so, you're admitting that you rule
2053
+ # and your tests are awesome.
2054
+ #
2055
+ # source://minitest//lib/minitest/test.rb#59
2056
+ def parallelize_me!; end
2057
+
2058
+ # Returns all instance methods starting with "test_". Based on
2059
+ # #test_order, the methods are either sorted, randomized
2060
+ # (default), or run in parallel.
2061
+ #
2062
+ # source://minitest//lib/minitest/test.rb#69
2063
+ def runnable_methods; end
2064
+
2065
+ # source://minitest-focus/1.4.0/lib/minitest/focus.rb#52
2066
+ def set_focus_trap; end
2067
+ end
2068
+ end
2069
+
2070
+ # Provides before/after hooks for setup and teardown. These are
2071
+ # meant for library writers, NOT for regular test authors. See
2072
+ # #before_setup for an example.
2073
+ #
2074
+ # source://minitest//lib/minitest/test.rb#113
2075
+ module Minitest::Test::LifecycleHooks
2076
+ # Runs before every test, after setup. This hook is meant for
2077
+ # libraries to extend minitest. It is not meant to be used by
2078
+ # test developers.
2079
+ #
2080
+ # See #before_setup for an example.
2081
+ #
2082
+ # source://minitest//lib/minitest/test.rb#163
2083
+ def after_setup; end
2084
+
2085
+ # Runs after every test, after teardown. This hook is meant for
2086
+ # libraries to extend minitest. It is not meant to be used by
2087
+ # test developers.
2088
+ #
2089
+ # See #before_setup for an example.
2090
+ #
2091
+ # source://minitest//lib/minitest/test.rb#187
2092
+ def after_teardown; end
2093
+
2094
+ # Runs before every test, before setup. This hook is meant for
2095
+ # libraries to extend minitest. It is not meant to be used by
2096
+ # test developers.
2097
+ #
2098
+ # As a simplistic example:
2099
+ #
2100
+ # module MyMinitestPlugin
2101
+ # def before_setup
2102
+ # super
2103
+ # # ... stuff to do before setup is run
2104
+ # end
2105
+ #
2106
+ # def after_setup
2107
+ # # ... stuff to do after setup is run
2108
+ # super
2109
+ # end
2110
+ #
2111
+ # def before_teardown
2112
+ # super
2113
+ # # ... stuff to do before teardown is run
2114
+ # end
2115
+ #
2116
+ # def after_teardown
2117
+ # # ... stuff to do after teardown is run
2118
+ # super
2119
+ # end
2120
+ # end
2121
+ #
2122
+ # class Minitest::Test
2123
+ # include MyMinitestPlugin
2124
+ # end
2125
+ #
2126
+ # source://minitest//lib/minitest/test.rb#148
2127
+ def before_setup; end
2128
+
2129
+ # Runs after every test, before teardown. This hook is meant for
2130
+ # libraries to extend minitest. It is not meant to be used by
2131
+ # test developers.
2132
+ #
2133
+ # See #before_setup for an example.
2134
+ #
2135
+ # source://minitest//lib/minitest/test.rb#172
2136
+ def before_teardown; end
2137
+
2138
+ # Runs before every test. Use this to set up before each test
2139
+ # run.
2140
+ #
2141
+ # source://minitest//lib/minitest/test.rb#154
2142
+ def setup; end
2143
+
2144
+ # Runs after every test. Use this to clean up after each test
2145
+ # run.
2146
+ #
2147
+ # source://minitest//lib/minitest/test.rb#178
2148
+ def teardown; end
2149
+ end
2150
+
2151
+ # source://minitest//lib/minitest/test.rb#19
2152
+ Minitest::Test::PASSTHROUGH_EXCEPTIONS = T.let(T.unsafe(nil), Array)
2153
+
2154
+ # source://minitest//lib/minitest/test.rb#21
2155
+ Minitest::Test::SETUP_METHODS = T.let(T.unsafe(nil), Array)
2156
+
2157
+ # source://minitest//lib/minitest/test.rb#23
2158
+ Minitest::Test::TEARDOWN_METHODS = T.let(T.unsafe(nil), Array)
2159
+
2160
+ # Assertion wrapping an unexpected error that was raised during a run.
2161
+ #
2162
+ # source://minitest//lib/minitest.rb#1001
2163
+ class Minitest::UnexpectedError < ::Minitest::Assertion
2164
+ include ::Minitest::Compress
2165
+
2166
+ # @return [UnexpectedError] a new instance of UnexpectedError
2167
+ #
2168
+ # source://minitest//lib/minitest.rb#1007
2169
+ def initialize(error); end
2170
+
2171
+ # source://minitest//lib/minitest.rb#1020
2172
+ def backtrace; end
2173
+
2174
+ # TODO: figure out how to use `cause` instead
2175
+ #
2176
+ # source://minitest//lib/minitest.rb#1005
2177
+ def error; end
2178
+
2179
+ # TODO: figure out how to use `cause` instead
2180
+ #
2181
+ # source://minitest//lib/minitest.rb#1005
2182
+ def error=(_arg0); end
2183
+
2184
+ # source://minitest//lib/minitest.rb#1026
2185
+ def message; end
2186
+
2187
+ # source://minitest//lib/minitest.rb#1032
2188
+ def result_label; end
2189
+ end
2190
+
2191
+ # source://minitest//lib/minitest.rb#1024
2192
+ Minitest::UnexpectedError::BASE_RE = T.let(T.unsafe(nil), Regexp)
2193
+
2194
+ # source://minitest//lib/minitest.rb#12
2195
+ Minitest::VERSION = T.let(T.unsafe(nil), String)
2196
+
2197
+ # source://minitest//lib/minitest/mock.rb#1
2198
+ class MockExpectationError < ::StandardError; end
2199
+
2200
+ # source://minitest//lib/minitest/spec.rb#3
2201
+ class Module
2202
+ # source://minitest//lib/minitest/spec.rb#4
2203
+ def infect_an_assertion(meth, new_name, dont_flip = T.unsafe(nil)); end
2204
+ end
2205
+
2206
+ # source://minitest//lib/minitest/spec.rb#347
2207
+ class Object < ::BasicObject
2208
+ include ::Kernel
2209
+ include ::PP::ObjectMixin
2210
+ include ::Minitest::Expectations
2211
+
2212
+ # Add a temporary stubbed method replacing +name+ for the duration
2213
+ # of the +block+. If +val_or_callable+ responds to #call, then it
2214
+ # returns the result of calling it, otherwise returns the value
2215
+ # as-is. If stubbed method yields a block, +block_args+ will be
2216
+ # passed along. Cleans up the stub at the end of the +block+. The
2217
+ # method +name+ must exist before stubbing.
2218
+ #
2219
+ # def test_stale_eh
2220
+ # obj_under_test = Something.new
2221
+ # refute obj_under_test.stale?
2222
+ #
2223
+ # Time.stub :now, Time.at(0) do
2224
+ # assert obj_under_test.stale?
2225
+ # end
2226
+ # end
2227
+ # --
2228
+ # NOTE: keyword args in callables are NOT checked for correctness
2229
+ # against the existing method. Too many edge cases to be worth it.
2230
+ #
2231
+ # source://minitest//lib/minitest/mock.rb#280
2232
+ def stub(name, val_or_callable, *block_args, **block_kwargs, &block); end
2233
+ end