rbs 2.5.1 → 2.6.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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +1 -1
  3. data/.github/workflows/ruby.yml +3 -3
  4. data/CHANGELOG.md +44 -0
  5. data/Gemfile.lock +5 -5
  6. data/Rakefile +6 -38
  7. data/Steepfile +6 -2
  8. data/core/constants.rbs +1 -1
  9. data/core/env.rbs +1 -1323
  10. data/core/global_variables.rbs +1 -1
  11. data/core/hash.rbs +3 -3
  12. data/core/kernel.rbs +2 -2
  13. data/core/random.rbs +5 -220
  14. data/core/rational.rbs +3 -3
  15. data/core/rbs/unnamed/argf.rbs +965 -0
  16. data/core/rbs/unnamed/env_class.rbs +1325 -0
  17. data/core/rbs/unnamed/random.rbs +270 -0
  18. data/core/regexp.rbs +2 -3
  19. data/docs/CONTRIBUTING.md +2 -2
  20. data/ext/rbs_extension/lexer.c +1343 -1353
  21. data/ext/rbs_extension/lexer.re +2 -2
  22. data/ext/rbs_extension/rbs_extension.h +1 -1
  23. data/ext/rbs_extension/unescape.c +17 -10
  24. data/lib/rbs/ast/members.rb +6 -3
  25. data/lib/rbs/cli.rb +2 -0
  26. data/lib/rbs/factory.rb +2 -0
  27. data/lib/rbs/prototype/helpers.rb +1 -5
  28. data/lib/rbs/prototype/rb.rb +105 -56
  29. data/lib/rbs/prototype/rbi.rb +65 -30
  30. data/lib/rbs/prototype/runtime.rb +4 -3
  31. data/lib/rbs/test/setup_helper.rb +6 -1
  32. data/lib/rbs/version.rb +1 -1
  33. data/schema/members.json +4 -1
  34. data/sig/collection/config.rbs +3 -0
  35. data/sig/factory.rbs +5 -0
  36. data/sig/prototype/helpers.rbs +23 -0
  37. data/sig/prototype/rb.rbs +84 -0
  38. data/sig/prototype/rbi.rbs +73 -0
  39. data/sig/shims/abstract_syntax_tree.rbs +25 -0
  40. data/sig/shims/enumerable.rbs +5 -0
  41. data/sig/shims/pp.rbs +3 -0
  42. data/sig/shims/ripper.rbs +8 -0
  43. data/stdlib/cgi/0/manifest.yaml +2 -0
  44. data/stdlib/date/0/time.rbs +26 -0
  45. data/stdlib/etc/0/etc.rbs +745 -0
  46. data/stdlib/minitest/0/kernel.rbs +42 -0
  47. data/stdlib/minitest/0/manifest.yaml +2 -0
  48. data/stdlib/minitest/0/minitest/abstract_reporter.rbs +49 -0
  49. data/stdlib/minitest/0/minitest/assertion.rbs +16 -0
  50. data/stdlib/minitest/0/minitest/assertions.rbs +545 -0
  51. data/stdlib/minitest/0/minitest/backtrace_filter.rbs +16 -0
  52. data/stdlib/minitest/0/minitest/bench_spec.rbs +102 -0
  53. data/stdlib/minitest/0/minitest/benchmark.rbs +258 -0
  54. data/stdlib/minitest/0/minitest/composite_reporter.rbs +25 -0
  55. data/stdlib/minitest/0/minitest/expectation.rbs +2 -0
  56. data/stdlib/minitest/0/minitest/expectations.rbs +21 -0
  57. data/stdlib/minitest/0/minitest/guard.rbs +64 -0
  58. data/stdlib/minitest/0/minitest/mock.rbs +60 -0
  59. data/stdlib/minitest/0/minitest/parallel/executor.rbs +42 -0
  60. data/stdlib/minitest/0/minitest/parallel/test/class_methods.rbs +6 -0
  61. data/stdlib/minitest/0/minitest/parallel/test.rbs +3 -0
  62. data/stdlib/minitest/0/minitest/parallel.rbs +2 -0
  63. data/stdlib/minitest/0/minitest/pride_io.rbs +54 -0
  64. data/stdlib/minitest/0/minitest/pride_lol.rbs +17 -0
  65. data/stdlib/minitest/0/minitest/progress_reporter.rbs +11 -0
  66. data/stdlib/minitest/0/minitest/reportable.rbs +51 -0
  67. data/stdlib/minitest/0/minitest/reporter.rbs +5 -0
  68. data/stdlib/minitest/0/minitest/result.rbs +28 -0
  69. data/stdlib/minitest/0/minitest/runnable.rbs +131 -0
  70. data/stdlib/minitest/0/minitest/skip.rbs +6 -0
  71. data/stdlib/minitest/0/minitest/spec/dsl/instance_methods.rbs +48 -0
  72. data/stdlib/minitest/0/minitest/spec/dsl.rbs +125 -0
  73. data/stdlib/minitest/0/minitest/spec.rbs +11 -0
  74. data/stdlib/minitest/0/minitest/statistics_reporter.rbs +76 -0
  75. data/stdlib/minitest/0/minitest/summary_reporter.rbs +25 -0
  76. data/stdlib/minitest/0/minitest/test/lifecycle_hooks.rbs +92 -0
  77. data/stdlib/minitest/0/minitest/test.rbs +76 -0
  78. data/stdlib/minitest/0/minitest/unexpected_error.rbs +10 -0
  79. data/stdlib/minitest/0/minitest/unit/test_case.rbs +3 -0
  80. data/stdlib/minitest/0/minitest/unit.rbs +5 -0
  81. data/stdlib/minitest/0/minitest.rbs +966 -0
  82. data/stdlib/rubygems/0/errors.rbs +113 -0
  83. metadata +54 -4
  84. data/lib/rbs/char_scanner.rb +0 -20
@@ -0,0 +1,102 @@
1
+ # <!-- rdoc-file=lib/minitest/benchmark.rb -->
2
+ # The spec version of Minitest::Benchmark.
3
+ #
4
+ class Minitest::BenchSpec < ::Minitest::Benchmark
5
+ # <!--
6
+ # rdoc-file=lib/minitest/benchmark.rb
7
+ # - bench(name, &block)
8
+ # -->
9
+ # This is used to define a new benchmark method. You usually don't use this
10
+ # directly and is intended for those needing to write new performance curve fits
11
+ # (eg: you need a specific polynomial fit).
12
+ #
13
+ # See ::bench_performance_linear for an example of how to use this.
14
+ #
15
+ def self.bench: (untyped name) ?{ () -> untyped } -> untyped
16
+
17
+ # <!--
18
+ # rdoc-file=lib/minitest/benchmark.rb
19
+ # - bench_range(&block)
20
+ # -->
21
+ # Specifies the ranges used for benchmarking for that class.
22
+ #
23
+ # bench_range do
24
+ # bench_exp(2, 16, 2)
25
+ # end
26
+ #
27
+ # See Minitest::Benchmark#bench_range for more details.
28
+ #
29
+ def self.bench_range: () ?{ () -> untyped } -> untyped
30
+
31
+ # <!--
32
+ # rdoc-file=lib/minitest/benchmark.rb
33
+ # - bench_performance_linear(name, threshold = 0.99, &work)
34
+ # -->
35
+ # Create a benchmark that verifies that the performance is linear.
36
+ #
37
+ # describe "my class Bench" do
38
+ # bench_performance_linear "fast_algorithm", 0.9999 do |n|
39
+ # @obj.fast_algorithm(n)
40
+ # end
41
+ # end
42
+ #
43
+ def self.bench_performance_linear: (untyped name, ?::Float threshold) ?{ () -> untyped } -> untyped
44
+
45
+ # <!--
46
+ # rdoc-file=lib/minitest/benchmark.rb
47
+ # - bench_performance_constant(name, threshold = 0.99, &work)
48
+ # -->
49
+ # Create a benchmark that verifies that the performance is constant.
50
+ #
51
+ # describe "my class Bench" do
52
+ # bench_performance_constant "zoom_algorithm!" do |n|
53
+ # @obj.zoom_algorithm!(n)
54
+ # end
55
+ # end
56
+ #
57
+ def self.bench_performance_constant: (untyped name, ?::Float threshold) ?{ () -> untyped } -> untyped
58
+
59
+ # <!--
60
+ # rdoc-file=lib/minitest/benchmark.rb
61
+ # - bench_performance_exponential(name, threshold = 0.99, &work)
62
+ # -->
63
+ # Create a benchmark that verifies that the performance is exponential.
64
+ #
65
+ # describe "my class Bench" do
66
+ # bench_performance_exponential "algorithm" do |n|
67
+ # @obj.algorithm(n)
68
+ # end
69
+ # end
70
+ #
71
+ def self.bench_performance_exponential: (untyped name, ?::Float threshold) ?{ () -> untyped } -> untyped
72
+
73
+ # <!--
74
+ # rdoc-file=lib/minitest/benchmark.rb
75
+ # - bench_performance_logarithmic(name, threshold = 0.99, &work)
76
+ # -->
77
+ # Create a benchmark that verifies that the performance is logarithmic.
78
+ #
79
+ # describe "my class Bench" do
80
+ # bench_performance_logarithmic "algorithm" do |n|
81
+ # @obj.algorithm(n)
82
+ # end
83
+ # end
84
+ #
85
+ def self.bench_performance_logarithmic: (untyped name, ?::Float threshold) ?{ () -> untyped } -> untyped
86
+
87
+ # <!--
88
+ # rdoc-file=lib/minitest/benchmark.rb
89
+ # - bench_performance_power(name, threshold = 0.99, &work)
90
+ # -->
91
+ # Create a benchmark that verifies that the performance is power.
92
+ #
93
+ # describe "my class Bench" do
94
+ # bench_performance_power "algorithm" do |n|
95
+ # @obj.algorithm(n)
96
+ # end
97
+ # end
98
+ #
99
+ def self.bench_performance_power: (untyped name, ?::Float threshold) ?{ () -> untyped } -> untyped
100
+ include Minitest::Spec::DSL::InstanceMethods
101
+ extend Minitest::Spec::DSL
102
+ end
@@ -0,0 +1,258 @@
1
+ # <!-- rdoc-file=lib/minitest/benchmark.rb -->
2
+ # Subclass Benchmark to create your own benchmark runs. Methods starting with
3
+ # "bench_" get executed on a per-class.
4
+ #
5
+ # See Minitest::Assertions
6
+ #
7
+ class Minitest::Benchmark < ::Minitest::Test
8
+ def self.io: () -> untyped
9
+ def io: () -> untyped
10
+ def self.run: (untyped reporter, ?::Hash[untyped, untyped] options) -> untyped
11
+ def self.runnable_methods: () -> untyped
12
+
13
+ # <!--
14
+ # rdoc-file=lib/minitest/benchmark.rb
15
+ # - bench_exp(min, max, base = 10)
16
+ # -->
17
+ # Returns a set of ranges stepped exponentially from `min` to `max` by powers of
18
+ # `base`. Eg:
19
+ #
20
+ # bench_exp(2, 16, 2) # => [2, 4, 8, 16]
21
+ #
22
+ def self.bench_exp: (untyped min, untyped max, ?::Integer base) -> untyped
23
+
24
+ # <!--
25
+ # rdoc-file=lib/minitest/benchmark.rb
26
+ # - bench_linear(min, max, step = 10)
27
+ # -->
28
+ # Returns a set of ranges stepped linearly from `min` to `max` by `step`. Eg:
29
+ #
30
+ # bench_linear(20, 40, 10) # => [20, 30, 40]
31
+ #
32
+ def self.bench_linear: (untyped min, untyped max, ?::Integer step) -> untyped
33
+
34
+ # <!--
35
+ # rdoc-file=lib/minitest/benchmark.rb
36
+ # - bench_range()
37
+ # -->
38
+ # Specifies the ranges used for benchmarking for that class. Defaults to
39
+ # exponential growth from 1 to 10k by powers of 10. Override if you need
40
+ # different ranges for your benchmarks.
41
+ #
42
+ # See also: ::bench_exp and ::bench_linear.
43
+ #
44
+ def self.bench_range: () -> untyped
45
+
46
+ # <!--
47
+ # rdoc-file=lib/minitest/benchmark.rb
48
+ # - assert_performance(validation, &work)
49
+ # -->
50
+ # Runs the given `work`, gathering the times of each run. Range and times are
51
+ # then passed to a given `validation` proc. Outputs the benchmark name and times
52
+ # in tab-separated format, making it easy to paste into a spreadsheet for
53
+ # graphing or further analysis.
54
+ #
55
+ # Ranges are specified by ::bench_range.
56
+ #
57
+ # Eg:
58
+ #
59
+ # def bench_algorithm
60
+ # validation = proc { |x, y| ... }
61
+ # assert_performance validation do |n|
62
+ # @obj.algorithm(n)
63
+ # end
64
+ # end
65
+ #
66
+ def assert_performance: (untyped validation) ?{ () -> untyped } -> untyped
67
+
68
+ # <!--
69
+ # rdoc-file=lib/minitest/benchmark.rb
70
+ # - assert_performance_constant(threshold = 0.99, &work)
71
+ # -->
72
+ # Runs the given `work` and asserts that the times gathered fit to match a
73
+ # constant rate (eg, linear slope == 0) within a given `threshold`. Note:
74
+ # because we're testing for a slope of 0, R^2 is not a good determining factor
75
+ # for the fit, so the threshold is applied against the slope itself. As such,
76
+ # you probably want to tighten it from the default.
77
+ #
78
+ # See
79
+ # https://www.graphpad.com/guides/prism/8/curve-fitting/reg_intepretingnonlinr2.
80
+ # htm for more details.
81
+ #
82
+ # Fit is calculated by #fit_linear.
83
+ #
84
+ # Ranges are specified by ::bench_range.
85
+ #
86
+ # Eg:
87
+ #
88
+ # def bench_algorithm
89
+ # assert_performance_constant 0.9999 do |n|
90
+ # @obj.algorithm(n)
91
+ # end
92
+ # end
93
+ #
94
+ def assert_performance_constant: (?::Float threshold) ?{ () -> untyped } -> untyped
95
+
96
+ # <!--
97
+ # rdoc-file=lib/minitest/benchmark.rb
98
+ # - assert_performance_exponential(threshold = 0.99, &work)
99
+ # -->
100
+ # Runs the given `work` and asserts that the times gathered fit to match a
101
+ # exponential curve within a given error `threshold`.
102
+ #
103
+ # Fit is calculated by #fit_exponential.
104
+ #
105
+ # Ranges are specified by ::bench_range.
106
+ #
107
+ # Eg:
108
+ #
109
+ # def bench_algorithm
110
+ # assert_performance_exponential 0.9999 do |n|
111
+ # @obj.algorithm(n)
112
+ # end
113
+ # end
114
+ #
115
+ def assert_performance_exponential: (?::Float threshold) ?{ () -> untyped } -> untyped
116
+
117
+ # <!--
118
+ # rdoc-file=lib/minitest/benchmark.rb
119
+ # - assert_performance_logarithmic(threshold = 0.99, &work)
120
+ # -->
121
+ # Runs the given `work` and asserts that the times gathered fit to match a
122
+ # logarithmic curve within a given error `threshold`.
123
+ #
124
+ # Fit is calculated by #fit_logarithmic.
125
+ #
126
+ # Ranges are specified by ::bench_range.
127
+ #
128
+ # Eg:
129
+ #
130
+ # def bench_algorithm
131
+ # assert_performance_logarithmic 0.9999 do |n|
132
+ # @obj.algorithm(n)
133
+ # end
134
+ # end
135
+ #
136
+ def assert_performance_logarithmic: (?::Float threshold) ?{ () -> untyped } -> untyped
137
+
138
+ # <!--
139
+ # rdoc-file=lib/minitest/benchmark.rb
140
+ # - assert_performance_linear(threshold = 0.99, &work)
141
+ # -->
142
+ # Runs the given `work` and asserts that the times gathered fit to match a
143
+ # straight line within a given error `threshold`.
144
+ #
145
+ # Fit is calculated by #fit_linear.
146
+ #
147
+ # Ranges are specified by ::bench_range.
148
+ #
149
+ # Eg:
150
+ #
151
+ # def bench_algorithm
152
+ # assert_performance_linear 0.9999 do |n|
153
+ # @obj.algorithm(n)
154
+ # end
155
+ # end
156
+ #
157
+ def assert_performance_linear: (?::Float threshold) ?{ () -> untyped } -> untyped
158
+
159
+ # <!--
160
+ # rdoc-file=lib/minitest/benchmark.rb
161
+ # - assert_performance_power(threshold = 0.99, &work)
162
+ # -->
163
+ # Runs the given `work` and asserts that the times gathered curve fit to match a
164
+ # power curve within a given error `threshold`.
165
+ #
166
+ # Fit is calculated by #fit_power.
167
+ #
168
+ # Ranges are specified by ::bench_range.
169
+ #
170
+ # Eg:
171
+ #
172
+ # def bench_algorithm
173
+ # assert_performance_power 0.9999 do |x|
174
+ # @obj.algorithm
175
+ # end
176
+ # end
177
+ #
178
+ def assert_performance_power: (?::Float threshold) ?{ () -> untyped } -> untyped
179
+
180
+ # <!--
181
+ # rdoc-file=lib/minitest/benchmark.rb
182
+ # - fit_error(xys) { |x| ... }
183
+ # -->
184
+ # Takes an array of x/y pairs and calculates the general R^2 value.
185
+ #
186
+ # See: http://en.wikipedia.org/wiki/Coefficient_of_determination
187
+ #
188
+ def fit_error: (untyped xys) { (untyped) -> untyped } -> untyped
189
+
190
+ # <!--
191
+ # rdoc-file=lib/minitest/benchmark.rb
192
+ # - fit_exponential(xs, ys)
193
+ # -->
194
+ # To fit a functional form: y = ae^(bx).
195
+ #
196
+ # Takes x and y values and returns [a, b, r^2].
197
+ #
198
+ # See: http://mathworld.wolfram.com/LeastSquaresFittingExponential.html
199
+ #
200
+ def fit_exponential: (untyped xs, untyped ys) -> untyped
201
+
202
+ # <!--
203
+ # rdoc-file=lib/minitest/benchmark.rb
204
+ # - fit_logarithmic(xs, ys)
205
+ # -->
206
+ # To fit a functional form: y = a + b*ln(x).
207
+ #
208
+ # Takes x and y values and returns [a, b, r^2].
209
+ #
210
+ # See: http://mathworld.wolfram.com/LeastSquaresFittingLogarithmic.html
211
+ #
212
+ def fit_logarithmic: (untyped xs, untyped ys) -> untyped
213
+
214
+ # <!--
215
+ # rdoc-file=lib/minitest/benchmark.rb
216
+ # - fit_linear(xs, ys)
217
+ # -->
218
+ # Fits the functional form: a + bx.
219
+ #
220
+ # Takes x and y values and returns [a, b, r^2].
221
+ #
222
+ # See: http://mathworld.wolfram.com/LeastSquaresFitting.html
223
+ #
224
+ def fit_linear: (untyped xs, untyped ys) -> untyped
225
+
226
+ # <!--
227
+ # rdoc-file=lib/minitest/benchmark.rb
228
+ # - fit_power(xs, ys)
229
+ # -->
230
+ # To fit a functional form: y = ax^b.
231
+ #
232
+ # Takes x and y values and returns [a, b, r^2].
233
+ #
234
+ # See: http://mathworld.wolfram.com/LeastSquaresFittingPowerLaw.html
235
+ #
236
+ def fit_power: (untyped xs, untyped ys) -> untyped
237
+
238
+ # <!--
239
+ # rdoc-file=lib/minitest/benchmark.rb
240
+ # - sigma(enum, &block)
241
+ # -->
242
+ # Enumerates over `enum` mapping `block` if given, returning the sum of the
243
+ # result. Eg:
244
+ #
245
+ # sigma([1, 2, 3]) # => 1 + 2 + 3 => 6
246
+ # sigma([1, 2, 3]) { |n| n ** 2 } # => 1 + 4 + 9 => 14
247
+ #
248
+ def sigma: (untyped enum) ?{ () -> untyped } -> untyped
249
+
250
+ # <!--
251
+ # rdoc-file=lib/minitest/benchmark.rb
252
+ # - validation_for_fit(msg, threshold)
253
+ # -->
254
+ # Returns a proc that calls the specified fit method and asserts that the error
255
+ # is within a tolerable threshold.
256
+ #
257
+ def validation_for_fit: (untyped msg, untyped threshold) -> untyped
258
+ end
@@ -0,0 +1,25 @@
1
+ # <!-- rdoc-file=lib/minitest.rb -->
2
+ # Dispatch to multiple reporters as one.
3
+ #
4
+ class Minitest::CompositeReporter < ::Minitest::AbstractReporter
5
+ def initialize: (*untyped reporters) -> void
6
+ def io: () -> untyped
7
+
8
+ # <!--
9
+ # rdoc-file=lib/minitest.rb
10
+ # - <<(reporter)
11
+ # -->
12
+ # Add another reporter to the mix.
13
+ #
14
+ def <<: (untyped reporter) -> untyped
15
+ def passed?: () -> untyped
16
+ def start: () -> untyped
17
+ def prerecord: (untyped klass, untyped name) -> untyped
18
+ def record: (untyped result) -> untyped
19
+ def report: () -> untyped
20
+
21
+ # <!-- rdoc-file=lib/minitest.rb -->
22
+ # The list of reporters to dispatch to.
23
+ #
24
+ attr_accessor reporters: untyped
25
+ end
@@ -0,0 +1,2 @@
1
+ class Minitest::Expectation < ::Struct[untyped]
2
+ end
@@ -0,0 +1,21 @@
1
+ # <!-- rdoc-file=lib/minitest/expectations.rb -->
2
+ # It's where you hide your "assertions".
3
+ #
4
+ # Please note, because of the way that expectations are implemented, all
5
+ # expectations (eg must_equal) are dependent upon a thread local variable
6
+ # `:current_spec`. If your specs rely on mixing threads into the specs
7
+ # themselves, you're better off using assertions or the new _(value) wrapper.
8
+ # For example:
9
+ #
10
+ # it "should still work in threads" do
11
+ # my_threaded_thingy do
12
+ # (1+1).must_equal 2 # bad
13
+ # assert_equal 2, 1+1 # good
14
+ # _(1 + 1).must_equal 2 # good
15
+ # value(1 + 1).must_equal 2 # good, also #expect
16
+ # _ { 1 + "1" }.must_raise TypeError # good
17
+ # end
18
+ # end
19
+ #
20
+ module Minitest::Expectations
21
+ end
@@ -0,0 +1,64 @@
1
+ # <!-- rdoc-file=lib/minitest.rb -->
2
+ # Provides a simple set of guards that you can use in your tests to skip
3
+ # execution if it is not applicable. These methods are mixed into Test as both
4
+ # instance and class methods so you can use them inside or outside of the test
5
+ # methods.
6
+ #
7
+ # def test_something_for_mri
8
+ # skip "bug 1234" if jruby?
9
+ # # ...
10
+ # end
11
+ #
12
+ # if windows? then
13
+ # # ... lots of test methods ...
14
+ # end
15
+ #
16
+ module Minitest::Guard
17
+ # <!--
18
+ # rdoc-file=lib/minitest.rb
19
+ # - jruby?(platform = RUBY_PLATFORM)
20
+ # -->
21
+ # Is this running on jruby?
22
+ #
23
+ def jruby?: (?untyped platform) -> untyped
24
+
25
+ # <!--
26
+ # rdoc-file=lib/minitest.rb
27
+ # - maglev?(platform = defined?(RUBY_ENGINE) && RUBY_ENGINE)
28
+ # -->
29
+ # Is this running on maglev?
30
+ #
31
+ def maglev?: (?untyped platform) -> untyped
32
+
33
+ # <!--
34
+ # rdoc-file=lib/minitest.rb
35
+ # - mri?(platform = RUBY_DESCRIPTION)
36
+ # -->
37
+ # Is this running on mri?
38
+ #
39
+ def mri?: (?untyped platform) -> untyped
40
+
41
+ # <!--
42
+ # rdoc-file=lib/minitest.rb
43
+ # - osx?(platform = RUBY_PLATFORM)
44
+ # -->
45
+ # Is this running on macOS?
46
+ #
47
+ def osx?: (?untyped platform) -> untyped
48
+
49
+ # <!--
50
+ # rdoc-file=lib/minitest.rb
51
+ # - rubinius?(platform = defined?(RUBY_ENGINE) && RUBY_ENGINE)
52
+ # -->
53
+ # Is this running on rubinius?
54
+ #
55
+ def rubinius?: (?untyped platform) -> untyped
56
+
57
+ # <!--
58
+ # rdoc-file=lib/minitest.rb
59
+ # - windows?(platform = RUBY_PLATFORM)
60
+ # -->
61
+ # Is this running on windows?
62
+ #
63
+ def windows?: (?untyped platform) -> untyped
64
+ end
@@ -0,0 +1,60 @@
1
+ # <!-- rdoc-file=lib/minitest/mock.rb -->
2
+ # A simple and clean mock object framework.
3
+ #
4
+ # All mock objects are an instance of Mock
5
+ #
6
+ class Minitest::Mock
7
+ alias __respond_to? respond_to?
8
+ def initialize: (?untyped? delegator) -> void
9
+
10
+ # <!--
11
+ # rdoc-file=lib/minitest/mock.rb
12
+ # - expect(name, retval, args = [], &blk)
13
+ # -->
14
+ # Expect that method `name` is called, optionally with `args` or a `blk`, and
15
+ # returns `retval`.
16
+ #
17
+ # @mock.expect(:meaning_of_life, 42)
18
+ # @mock.meaning_of_life # => 42
19
+ #
20
+ # @mock.expect(:do_something_with, true, [some_obj, true])
21
+ # @mock.do_something_with(some_obj, true) # => true
22
+ #
23
+ # @mock.expect(:do_something_else, true) do |a1, a2|
24
+ # a1 == "buggs" && a2 == :bunny
25
+ # end
26
+ #
27
+ # `args` is compared to the expected args using case equality (ie, the '==='
28
+ # operator), allowing for less specific expectations.
29
+ #
30
+ # @mock.expect(:uses_any_string, true, [String])
31
+ # @mock.uses_any_string("foo") # => true
32
+ # @mock.verify # => true
33
+ #
34
+ # @mock.expect(:uses_one_string, true, ["foo"])
35
+ # @mock.uses_one_string("bar") # => raises MockExpectationError
36
+ #
37
+ # If a method will be called multiple times, specify a new expect for each one.
38
+ # They will be used in the order you define them.
39
+ #
40
+ # @mock.expect(:ordinal_increment, 'first')
41
+ # @mock.expect(:ordinal_increment, 'second')
42
+ #
43
+ # @mock.ordinal_increment # => 'first'
44
+ # @mock.ordinal_increment # => 'second'
45
+ # @mock.ordinal_increment # => raises MockExpectationError "No more expects available for :ordinal_increment"
46
+ #
47
+ def expect: (untyped name, untyped retval, ?untyped args) ?{ () -> untyped } -> self
48
+ def __call: (untyped name, untyped data) -> untyped
49
+
50
+ # <!--
51
+ # rdoc-file=lib/minitest/mock.rb
52
+ # - verify()
53
+ # -->
54
+ # Verify that all methods were called as expected. Raises `MockExpectationError`
55
+ # if the mock object was not called as expected.
56
+ #
57
+ def verify: () -> true
58
+ def method_missing: (untyped sym, *untyped args) ?{ () -> untyped } -> untyped
59
+ def respond_to?: (untyped sym, ?bool include_private) -> (true | untyped)
60
+ end
@@ -0,0 +1,42 @@
1
+ # <!-- rdoc-file=lib/minitest/parallel.rb -->
2
+ # The engine used to run multiple tests in parallel.
3
+ #
4
+ class Minitest::Parallel::Executor
5
+ # <!--
6
+ # rdoc-file=lib/minitest/parallel.rb
7
+ # - new(size)
8
+ # -->
9
+ # Create a parallel test executor of with `size` workers.
10
+ #
11
+ def initialize: (untyped size) -> void
12
+
13
+ # <!--
14
+ # rdoc-file=lib/minitest/parallel.rb
15
+ # - start()
16
+ # -->
17
+ # Start the executor
18
+ #
19
+ def start: () -> untyped
20
+
21
+ # <!--
22
+ # rdoc-file=lib/minitest/parallel.rb
23
+ # - <<(work;)
24
+ # -->
25
+ # Add a job to the queue
26
+ #
27
+ def <<: (untyped work) -> untyped
28
+
29
+ # <!--
30
+ # rdoc-file=lib/minitest/parallel.rb
31
+ # - shutdown()
32
+ # -->
33
+ # Shuts down the pool of workers by signalling them to quit and waiting for them
34
+ # all to finish what they're currently working on.
35
+ #
36
+ def shutdown: () -> untyped
37
+
38
+ # <!-- rdoc-file=lib/minitest/parallel.rb -->
39
+ # The size of the pool of workers.
40
+ #
41
+ attr_reader size: untyped
42
+ end
@@ -0,0 +1,6 @@
1
+ module Minitest::Parallel::Test::ClassMethods
2
+ # :nodoc:
3
+ def run_one_method: (untyped klass, untyped method_name, untyped reporter) -> untyped
4
+
5
+ def test_order: () -> :parallel
6
+ end
@@ -0,0 +1,3 @@
1
+ module Minitest::Parallel::Test
2
+ def _synchronize: () { () -> untyped } -> untyped
3
+ end
@@ -0,0 +1,2 @@
1
+ module Minitest::Parallel
2
+ end
@@ -0,0 +1,54 @@
1
+ # <!-- rdoc-file=lib/minitest/pride_plugin.rb -->
2
+ # Show your testing pride!
3
+ #
4
+ class Minitest::PrideIO
5
+ # <!--
6
+ # rdoc-file=lib/minitest/pride_plugin.rb
7
+ # - pride!()
8
+ # -->
9
+ # Activate the pride plugin. Called from both -p option and minitest/pride
10
+ #
11
+ def self.pride!: () -> untyped
12
+
13
+ # <!--
14
+ # rdoc-file=lib/minitest/pride_plugin.rb
15
+ # - pride?()
16
+ # -->
17
+ # Are we showing our testing pride?
18
+ #
19
+ def self.pride?: () -> untyped
20
+ def initialize: (untyped io) -> void
21
+
22
+ # <!--
23
+ # rdoc-file=lib/minitest/pride_plugin.rb
24
+ # - print(o)
25
+ # -->
26
+ # Wrap print to colorize the output.
27
+ #
28
+ def print: (untyped o) -> untyped
29
+ def puts: (*untyped o) -> untyped
30
+
31
+ # <!--
32
+ # rdoc-file=lib/minitest/pride_plugin.rb
33
+ # - pride(string)
34
+ # -->
35
+ # Color a string.
36
+ #
37
+ def pride: (untyped string) -> ::String
38
+ def method_missing: (untyped msg, *untyped args) -> untyped
39
+
40
+ # <!-- rdoc-file=lib/minitest/pride_plugin.rb -->
41
+ # The IO we're going to pipe through.
42
+ #
43
+ attr_reader io: untyped
44
+
45
+ # <!-- rdoc-file=lib/minitest/pride_plugin.rb -->
46
+ # Start an escape sequence
47
+ #
48
+ ESC: String
49
+
50
+ # <!-- rdoc-file=lib/minitest/pride_plugin.rb -->
51
+ # End the escape sequence
52
+ #
53
+ NND: String
54
+ end
@@ -0,0 +1,17 @@
1
+ # <!-- rdoc-file=lib/minitest/pride_plugin.rb -->
2
+ # If you thought the PrideIO was colorful...
3
+ #
4
+ # (Inspired by lolcat, but with clean math)
5
+ #
6
+ class Minitest::PrideLOL < ::Minitest::PrideIO
7
+ def initialize: (untyped io) -> void
8
+
9
+ # <!--
10
+ # rdoc-file=lib/minitest/pride_plugin.rb
11
+ # - pride(string)
12
+ # -->
13
+ # Make the string even more colorful. Damnit.
14
+ #
15
+ def pride: (untyped string) -> ::String
16
+ PI_3: Float
17
+ end
@@ -0,0 +1,11 @@
1
+ # <!-- rdoc-file=lib/minitest.rb -->
2
+ # A very simple reporter that prints the "dots" during the run.
3
+ #
4
+ # This is added to the top-level CompositeReporter at the start of the run. If
5
+ # you want to change the output of minitest via a plugin, pull this out of the
6
+ # composite and replace it with your own.
7
+ #
8
+ class Minitest::ProgressReporter < ::Minitest::Reporter
9
+ def prerecord: (untyped klass, untyped name) -> (untyped | nil)
10
+ def record: (untyped result) -> untyped
11
+ end