packwerk 3.2.3 → 3.3.1

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