ori-rb 0.4

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