orthoses-rails 0.4.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -39
  3. data/examples/rails/Gemfile +16 -0
  4. data/examples/rails/Gemfile.lock +178 -0
  5. data/examples/rails/Rakefile +149 -193
  6. data/examples/rails/config/database.yml +8 -0
  7. data/examples/rails/config/storage.yml +3 -0
  8. data/examples/rails/known_sig/actionpack/7.0/action_controller/metal.rbs +4 -0
  9. data/{lib/orthoses/active_model/known_sig/7.0 → examples/rails/known_sig/activemodel/7.0/active_model}/serialization.rbs +0 -0
  10. data/{lib/orthoses/active_model/known_sig/7.0 → examples/rails/known_sig/activemodel/7.0/active_model}/validations.rbs +0 -0
  11. data/examples/rails/known_sig/activerecord/6.0/_active_record_relation.rbs +49 -0
  12. data/examples/rails/known_sig/activerecord/6.0/_active_record_relation_class_methods.rbs +45 -0
  13. data/{lib/orthoses/active_record/known_sig/6.0 → examples/rails/known_sig/activerecord/6.0/active_record}/result.rbs +0 -0
  14. data/examples/rails/known_sig/activerecord/6.1/_active_record_relation.rbs +49 -0
  15. data/examples/rails/known_sig/activerecord/6.1/_active_record_relation_class_methods.rbs +45 -0
  16. data/{lib/orthoses/active_record/known_sig/6.1 → examples/rails/known_sig/activerecord/6.1/active_record}/result.rbs +0 -0
  17. data/examples/rails/known_sig/activerecord/7.0/_active_record_relation.rbs +49 -0
  18. data/examples/rails/known_sig/activerecord/7.0/_active_record_relation_class_methods.rbs +45 -0
  19. data/{lib/orthoses/active_record/known_sig/7.0 → examples/rails/known_sig/activerecord/7.0/active_record}/encryption/context.rbs +0 -0
  20. data/{lib/orthoses/active_record/known_sig/7.0 → examples/rails/known_sig/activerecord/7.0/active_record}/result.rbs +0 -0
  21. data/{lib/orthoses/active_support/known_sig → examples/rails/known_sig/activesupport}/7.0/active_support/callbacks/callback_chain.rbs +0 -0
  22. data/examples/rails/known_sig/activesupport/7.0/active_support/duration.rbs +4 -0
  23. data/{lib/orthoses/active_support/known_sig → examples/rails/known_sig/activesupport}/7.0/active_support/hash_with_indifferent_access.rbs +0 -0
  24. data/{lib/orthoses/active_support/known_sig → examples/rails/known_sig/activesupport}/7.0/active_support/multibyte/chars.rbs +0 -0
  25. data/examples/rails/known_sig/activesupport/7.0/active_support/time_with_zone.rbs +5 -0
  26. data/examples/rails/known_sig/activesupport/7.0/active_support/time_zone.rbs +3 -0
  27. data/examples/rails/known_sig/activesupport/7.0/date.rbs +6 -0
  28. data/examples/rails/known_sig/activesupport/7.0/date_and_time/zones.rbs +4 -0
  29. data/{lib/orthoses/active_support/known_sig → examples/rails/known_sig/activesupport}/7.0/hash_with_indifferent_access.rbs +0 -0
  30. data/examples/rails/known_sig/activesupport/7.0/integer.rbs +9 -0
  31. data/examples/rails/known_sig/activesupport/7.0/numeric.rbs +15 -0
  32. data/examples/rails/known_sig/activesupport/7.0/string.rbs +4 -0
  33. data/{lib/orthoses/active_support/known_sig → examples/rails/known_sig/activesupport}/7.0/time.rbs +8 -0
  34. data/examples/rails/tasks/action_pack.rake +141 -0
  35. data/examples/rails/tasks/action_view.rake +77 -0
  36. data/examples/rails/tasks/active_job.rake +99 -0
  37. data/examples/rails/tasks/active_model.rake +46 -0
  38. data/examples/rails/tasks/active_record.rake +88 -0
  39. data/examples/rails/tasks/active_storage.rake +94 -0
  40. data/examples/rails/tasks/active_support.rake +99 -0
  41. data/examples/rails/tasks/railties.rake +37 -0
  42. data/lib/orthoses/active_model/has_secure_password.rb +2 -10
  43. data/lib/orthoses/active_model.rb +0 -1
  44. data/lib/orthoses/active_record/delegated_type.rb +44 -0
  45. data/lib/orthoses/active_record/enum.rb +77 -0
  46. data/lib/orthoses/active_record/generated_attribute_methods.rb +1 -0
  47. data/lib/orthoses/active_record/scope.rb +63 -0
  48. data/lib/orthoses/active_record.rb +3 -1
  49. data/lib/orthoses/active_support/class_attribute.rb +3 -10
  50. data/lib/orthoses/active_support/configurable.rb +3 -2
  51. data/lib/orthoses/active_support/delegation.rb +11 -19
  52. data/lib/orthoses/active_support/mattr_accessor.rb +4 -12
  53. data/lib/orthoses/active_support/time_with_zone.rb +21 -3
  54. data/lib/orthoses/active_support.rb +0 -17
  55. data/lib/orthoses/rails/version.rb +1 -1
  56. data/lib/orthoses/rails.rb +1 -1
  57. data/lib/orthoses/railties/mixin.rb +107 -0
  58. data/lib/orthoses/railties.rb +3 -0
  59. data/orthoses-rails.gemspec +1 -1
  60. metadata +48 -89
  61. data/examples/rails/known_sig/action_cable/connection/test_cookie_jar.rbs +0 -2
  62. data/examples/rails/known_sig/action_controller/metal.rbs +0 -4
  63. data/examples/rails/known_sig/action_dispatch/cookies/cookie_jar.rbs +0 -3
  64. data/examples/rails/known_sig/action_dispatch/response.rbs +0 -4
  65. data/examples/rails/patch/drb/drb_undumped.rbs +0 -2
  66. data/examples/rails/patch/drb.rbs +0 -2
  67. data/examples/rails/patch/erubi/engine.rbs +0 -4
  68. data/examples/rails/patch/erubi.rbs +0 -2
  69. data/examples/rails/patch/minitest/kernel.rbs +0 -44
  70. data/examples/rails/patch/minitest/minitest/abstract_reporter.rbs +0 -49
  71. data/examples/rails/patch/minitest/minitest/assertion.rbs +0 -16
  72. data/examples/rails/patch/minitest/minitest/assertions.rbs +0 -545
  73. data/examples/rails/patch/minitest/minitest/backtrace_filter.rbs +0 -16
  74. data/examples/rails/patch/minitest/minitest/bench_spec.rbs +0 -101
  75. data/examples/rails/patch/minitest/minitest/benchmark.rbs +0 -258
  76. data/examples/rails/patch/minitest/minitest/composite_reporter.rbs +0 -25
  77. data/examples/rails/patch/minitest/minitest/expectations.rbs +0 -21
  78. data/examples/rails/patch/minitest/minitest/guard.rbs +0 -64
  79. data/examples/rails/patch/minitest/minitest/mock.rbs +0 -60
  80. data/examples/rails/patch/minitest/minitest/parallel/executor.rbs +0 -42
  81. data/examples/rails/patch/minitest/minitest/parallel/test/class_methods.rbs +0 -6
  82. data/examples/rails/patch/minitest/minitest/parallel/test.rbs +0 -3
  83. data/examples/rails/patch/minitest/minitest/parallel.rbs +0 -2
  84. data/examples/rails/patch/minitest/minitest/pride_io.rbs +0 -54
  85. data/examples/rails/patch/minitest/minitest/pride_lol.rbs +0 -17
  86. data/examples/rails/patch/minitest/minitest/progress_reporter.rbs +0 -11
  87. data/examples/rails/patch/minitest/minitest/reportable.rbs +0 -51
  88. data/examples/rails/patch/minitest/minitest/reporter.rbs +0 -5
  89. data/examples/rails/patch/minitest/minitest/result.rbs +0 -28
  90. data/examples/rails/patch/minitest/minitest/runnable.rbs +0 -131
  91. data/examples/rails/patch/minitest/minitest/skip.rbs +0 -6
  92. data/examples/rails/patch/minitest/minitest/spec/dsl/instance_methods.rbs +0 -48
  93. data/examples/rails/patch/minitest/minitest/spec/dsl.rbs +0 -125
  94. data/examples/rails/patch/minitest/minitest/spec.rbs +0 -10
  95. data/examples/rails/patch/minitest/minitest/statistics_reporter.rbs +0 -76
  96. data/examples/rails/patch/minitest/minitest/summary_reporter.rbs +0 -26
  97. data/examples/rails/patch/minitest/minitest/test/lifecycle_hooks.rbs +0 -92
  98. data/examples/rails/patch/minitest/minitest/test.rbs +0 -76
  99. data/examples/rails/patch/minitest/minitest/unexpected_error.rbs +0 -10
  100. data/examples/rails/patch/minitest/minitest/unit/test_case.rbs +0 -3
  101. data/examples/rails/patch/minitest/minitest/unit.rbs +0 -5
  102. data/examples/rails/patch/minitest/minitest.rbs +0 -966
  103. data/examples/rails/patch/pg/simple_decoder.rbs +0 -4
  104. data/examples/rails/patch/pg.rbs +0 -2
  105. data/examples/rails/patch/qc/queue.rbs +0 -2
  106. data/examples/rails/patch/qc.rbs +0 -2
  107. data/examples/rails/patch/que/job.rbs +0 -2
  108. data/examples/rails/patch/que.rbs +0 -2
  109. data/examples/rails/patch/rack/cache/entity_store.rbs +0 -2
  110. data/examples/rails/patch/rack/cache/meta_store.rbs +0 -2
  111. data/examples/rails/patch/rack/cache.rbs +0 -2
  112. data/examples/rails/patch/rack/session/dalli.rbs +0 -2
  113. data/examples/rails/patch/rack/session.rbs +0 -2
  114. data/examples/rails/patch/rboc.rbs +0 -2
  115. data/examples/rails/patch/rdoc/generator/sdoc.rbs +0 -3
  116. data/examples/rails/patch/rdoc/generator.rbs +0 -2
  117. data/examples/rails/patch/rdoc/task.rbs +0 -2
  118. data/examples/rails/patch/ripper.rbs +0 -2
  119. data/examples/rails/patch/sidekiq/worker.rbs +0 -2
  120. data/examples/rails/patch/sidekiq.rbs +0 -2
  121. data/examples/rails/patch/sneakers/worker.rbs +0 -2
  122. data/examples/rails/patch/sneakers.rbs +0 -2
  123. data/examples/rails/patch/sucker_punch/job.rbs +0 -2
  124. data/examples/rails/patch/sucker_punch.rbs +0 -2
  125. data/examples/rails/patch/thor/actions/create_file.rbs +0 -2
  126. data/examples/rails/patch/thor/actions.rbs +0 -2
  127. data/examples/rails/patch/thor/error.rbs +0 -2
  128. data/examples/rails/patch/thor/group.rbs +0 -2
  129. data/examples/rails/patch/thor.rbs +0 -2
  130. data/lib/orthoses/active_model/known_sig.rb +0 -21
  131. data/lib/orthoses/active_record/known_sig.rb +0 -21
  132. data/lib/orthoses/active_support/known_sig.rb +0 -21
  133. data/lib/orthoses/rails/known_sig_helper.rb +0 -22
@@ -1,258 +0,0 @@
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
@@ -1,25 +0,0 @@
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
@@ -1,21 +0,0 @@
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
@@ -1,64 +0,0 @@
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
@@ -1,60 +0,0 @@
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
@@ -1,42 +0,0 @@
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
@@ -1,6 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- module Minitest::Parallel::Test
2
- def _synchronize: () { () -> untyped } -> untyped
3
- end
@@ -1,2 +0,0 @@
1
- module Minitest::Parallel
2
- end
@@ -1,54 +0,0 @@
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
- # End the escape sequence
47
- #
48
- NND: String
49
-
50
- # <!-- rdoc-file=lib/minitest/pride_plugin.rb -->
51
- # Start an escape sequence
52
- #
53
- ESC: String
54
- end
@@ -1,17 +0,0 @@
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
@@ -1,11 +0,0 @@
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
@@ -1,51 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest.rb -->
2
- # Shared code for anything that can get passed to a Reporter. See Minitest::Test
3
- # & Minitest::Result.
4
- #
5
- module Minitest::Reportable
6
- # <!--
7
- # rdoc-file=lib/minitest.rb
8
- # - passed?()
9
- # -->
10
- # Did this run pass?
11
- #
12
- # Note: skipped runs are not considered passing, but they don't cause the
13
- # process to exit non-zero.
14
- #
15
- def passed?: () -> untyped
16
-
17
- # <!--
18
- # rdoc-file=lib/minitest.rb
19
- # - location()
20
- # -->
21
- # The location identifier of this test. Depends on a method existing called
22
- # class_name.
23
- #
24
- def location: () -> ::String
25
-
26
- def class_name: () -> untyped
27
-
28
- # <!--
29
- # rdoc-file=lib/minitest.rb
30
- # - result_code()
31
- # -->
32
- # Returns ".", "F", or "E" based on the result of the run.
33
- #
34
- def result_code: () -> untyped
35
-
36
- # <!--
37
- # rdoc-file=lib/minitest.rb
38
- # - skipped?()
39
- # -->
40
- # Was this run skipped?
41
- #
42
- def skipped?: () -> untyped
43
-
44
- # <!--
45
- # rdoc-file=lib/minitest.rb
46
- # - error?()
47
- # -->
48
- # Did this run error?
49
- #
50
- def error?: () -> untyped
51
- end
@@ -1,5 +0,0 @@
1
- class Minitest::Reporter < ::Minitest::AbstractReporter
2
- def initialize: (?untyped io, ?::Hash[untyped, untyped] options) -> void
3
- attr_accessor io: untyped
4
- attr_accessor options: untyped
5
- end
@@ -1,28 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest.rb -->
2
- # This represents a test result in a clean way that can be marshalled over a
3
- # wire. Tests can do anything they want to the test instance and can create
4
- # conditions that cause Marshal.dump to blow up. By using Result.from(a_test)
5
- # you can be reasonably sure that the test result can be marshalled.
6
- #
7
- class Minitest::Result < ::Minitest::Runnable
8
- # <!--
9
- # rdoc-file=lib/minitest.rb
10
- # - from(runnable)
11
- # -->
12
- # Create a new test result from a Runnable instance.
13
- #
14
- def self.from: (untyped runnable) -> untyped
15
- def class_name: () -> untyped
16
- def to_s: () -> untyped
17
-
18
- # <!-- rdoc-file=lib/minitest.rb -->
19
- # The class name of the test result.
20
- #
21
- attr_accessor klass: untyped
22
-
23
- # <!-- rdoc-file=lib/minitest.rb -->
24
- # The location of the test method.
25
- #
26
- attr_accessor source_location: untyped
27
- include Minitest::Reportable
28
- end