minitest 5.23.0 → 5.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +30 -0
- data/lib/minitest/autorun.rb +0 -7
- data/lib/minitest/parallel.rb +1 -1
- data/lib/minitest/test_task.rb +7 -1
- data/lib/minitest.rb +123 -93
- data/test/minitest/test_minitest_assertions.rb +2 -2
- data/test/minitest/test_minitest_test_task.rb +7 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddd0fe4703c1bc82b9c33eb3dca089b234e123893d379dc940791e2cbd74802f
|
4
|
+
data.tar.gz: cfdfd1306481c0ea6ed54f03952205f4ceb9c41d2a901640f599c453eec39e39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cde9b530576ab5a9fccf75e7ed171768b83ef8ad833a6de3a69384c3da219642b93ab0d6e00e2c13d5cf7a0a0ee7d85ce291523cc50ee9908c2d37454a654598
|
7
|
+
data.tar.gz: 5d9432e383458f01530a68e1b6d6e6531bb85ff772335e5fdb15646d8cd880429c5ed6965c9c8e879399628395d1557f67893dc39236874e2c24c2782f954fb3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
@@ -1,3 +1,33 @@
|
|
1
|
+
=== 5.24.0 / 2024-06-18
|
2
|
+
|
3
|
+
* 2 minor enhancements:
|
4
|
+
|
5
|
+
* Added Minitest.register_plugin.
|
6
|
+
* Extended plugin system to work with modules/classes for opt-out plugins.
|
7
|
+
|
8
|
+
* 1 bug fix:
|
9
|
+
|
10
|
+
* Removed anacronism, but allow load_plugins to exit gracefully if --disable=gems.
|
11
|
+
|
12
|
+
=== 5.23.1 / 2024-05-21
|
13
|
+
|
14
|
+
* 1 bug fix:
|
15
|
+
|
16
|
+
* Fully qualify the Queue class to avoid conflicts with other libraries. (rafaelfranca)
|
17
|
+
|
18
|
+
=== 5.23.0 / 2024-05-15
|
19
|
+
|
20
|
+
* 3 minor enhancements:
|
21
|
+
|
22
|
+
* Added -Werror to raise on any warning output. (byroot)
|
23
|
+
* Added UnexpectedWarning as a failure summary type, added count to output if activated.
|
24
|
+
* Added minitest/manual_plugins.rb w/ new Minitest.load method. (tenderlove)
|
25
|
+
|
26
|
+
* 2 bug fixes:
|
27
|
+
|
28
|
+
* Allow empty_run! and reporter to display summary for empty runs. (zzak)
|
29
|
+
* Make test task verbose using either rake's -v or -t (was just -t).
|
30
|
+
|
1
31
|
=== 5.22.3 / 2024-03-13
|
2
32
|
|
3
33
|
* 1 minor enhancement:
|
data/lib/minitest/autorun.rb
CHANGED
data/lib/minitest/parallel.rb
CHANGED
data/lib/minitest/test_task.rb
CHANGED
data/lib/minitest.rb
CHANGED
@@ -9,7 +9,7 @@ require_relative "minitest/compress"
|
|
9
9
|
# :include: README.rdoc
|
10
10
|
|
11
11
|
module Minitest
|
12
|
-
VERSION = "5.
|
12
|
+
VERSION = "5.24.0" # :nodoc:
|
13
13
|
|
14
14
|
@@installed_at_exit ||= false
|
15
15
|
@@after_run = []
|
@@ -98,20 +98,19 @@ module Minitest
|
|
98
98
|
@@after_run << block
|
99
99
|
end
|
100
100
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
101
|
+
##
|
102
|
+
# Register a plugin to be used. Does NOT require / load it.
|
103
|
+
|
104
|
+
def self.register_plugin name_or_mod
|
105
|
+
self.extensions << name_or_mod
|
106
|
+
nil
|
106
107
|
end
|
107
108
|
|
108
109
|
def self.load_plugins # :nodoc:
|
109
|
-
return unless
|
110
|
+
return unless defined? Gem
|
110
111
|
|
111
112
|
seen = {}
|
112
113
|
|
113
|
-
require "rubygems" unless defined? Gem
|
114
|
-
|
115
114
|
Gem.find_files("minitest/*_plugin.rb").each do |plugin_path|
|
116
115
|
name = File.basename plugin_path, "_plugin.rb"
|
117
116
|
|
@@ -123,88 +122,22 @@ module Minitest
|
|
123
122
|
end
|
124
123
|
end
|
125
124
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
# klass.new(runnable_method).run
|
142
|
-
|
143
|
-
def self.run args = []
|
144
|
-
self.load_plugins unless args.delete("--no-plugins") || ENV["MT_NO_PLUGINS"]
|
145
|
-
|
146
|
-
options = process_args args
|
147
|
-
|
148
|
-
Minitest.seed = options[:seed]
|
149
|
-
srand Minitest.seed
|
150
|
-
|
151
|
-
reporter = CompositeReporter.new
|
152
|
-
reporter << SummaryReporter.new(options[:io], options)
|
153
|
-
reporter << ProgressReporter.new(options[:io], options) unless options[:quiet]
|
154
|
-
|
155
|
-
self.reporter = reporter # this makes it available to plugins
|
156
|
-
self.init_plugins options
|
157
|
-
self.reporter = nil # runnables shouldn't depend on the reporter, ever
|
158
|
-
|
159
|
-
self.parallel_executor.start if parallel_executor.respond_to?(:start)
|
160
|
-
reporter.start
|
161
|
-
begin
|
162
|
-
__run reporter, options
|
163
|
-
rescue Interrupt
|
164
|
-
warn "Interrupted. Exiting..."
|
125
|
+
def self.init_plugins options # :nodoc:
|
126
|
+
self.extensions.each do |mod_or_meth|
|
127
|
+
case mod_or_meth
|
128
|
+
when Symbol, String then
|
129
|
+
name = mod_or_meth
|
130
|
+
msg = "plugin_#{name}_init"
|
131
|
+
next unless self.respond_to? msg
|
132
|
+
send msg, options
|
133
|
+
when Module then
|
134
|
+
recv = mod_or_meth
|
135
|
+
next unless recv.respond_to? :minitest_plugin_init
|
136
|
+
recv.minitest_plugin_init options
|
137
|
+
else
|
138
|
+
raise ArgumentError, "blahblah %p" % [mod_or_meth]
|
139
|
+
end
|
165
140
|
end
|
166
|
-
self.parallel_executor.shutdown
|
167
|
-
|
168
|
-
# might have been removed/replaced during init_plugins:
|
169
|
-
summary = reporter.reporters.grep(SummaryReporter).first
|
170
|
-
|
171
|
-
reporter.report
|
172
|
-
|
173
|
-
return empty_run! options if summary && summary.count == 0
|
174
|
-
reporter.passed?
|
175
|
-
end
|
176
|
-
|
177
|
-
def self.empty_run! options # :nodoc:
|
178
|
-
filter = options[:filter]
|
179
|
-
return true unless filter # no filter, but nothing ran == success
|
180
|
-
|
181
|
-
warn "Nothing ran for filter: %s" % [filter]
|
182
|
-
|
183
|
-
require "did_you_mean" # soft dependency, punt if it doesn't load
|
184
|
-
|
185
|
-
ms = Runnable.runnables.flat_map(&:runnable_methods)
|
186
|
-
cs = DidYouMean::SpellChecker.new(dictionary: ms).correct filter
|
187
|
-
|
188
|
-
warn DidYouMean::Formatter.message_for cs unless cs.empty?
|
189
|
-
rescue LoadError
|
190
|
-
# do nothing
|
191
|
-
end
|
192
|
-
|
193
|
-
##
|
194
|
-
# Internal run method. Responsible for telling all Runnable
|
195
|
-
# sub-classes to run.
|
196
|
-
|
197
|
-
def self.__run reporter, options
|
198
|
-
suites = Runnable.runnables.shuffle
|
199
|
-
parallel, serial = suites.partition { |s| s.test_order == :parallel }
|
200
|
-
|
201
|
-
# If we run the parallel tests before the serial tests, the parallel tests
|
202
|
-
# could run in parallel with the serial tests. This would be bad because
|
203
|
-
# the serial tests won't lock around Reporter#record. Run the serial tests
|
204
|
-
# first, so that after they complete, the parallel tests will lock when
|
205
|
-
# recording results.
|
206
|
-
serial.map { |suite| suite.run reporter, options } +
|
207
|
-
parallel.map { |suite| suite.run reporter, options }
|
208
141
|
end
|
209
142
|
|
210
143
|
def self.process_args args = [] # :nodoc:
|
@@ -271,9 +204,19 @@ module Minitest
|
|
271
204
|
opts.separator ""
|
272
205
|
opts.separator "Known extensions: #{extensions.join(", ")}"
|
273
206
|
|
274
|
-
extensions.each do |
|
275
|
-
|
276
|
-
|
207
|
+
extensions.each do |mod_or_meth|
|
208
|
+
case mod_or_meth
|
209
|
+
when Symbol, String then
|
210
|
+
meth = mod_or_meth
|
211
|
+
msg = "plugin_#{meth}_options"
|
212
|
+
send msg, opts, options if respond_to?(msg)
|
213
|
+
when Module
|
214
|
+
recv = mod_or_meth
|
215
|
+
next unless recv.respond_to? :minitest_plugin_options
|
216
|
+
recv.minitest_plugin_options opts, options
|
217
|
+
else
|
218
|
+
raise ArgumentError, "blahblah %p" % [mod_or_meth]
|
219
|
+
end
|
277
220
|
end
|
278
221
|
end
|
279
222
|
|
@@ -303,6 +246,93 @@ module Minitest
|
|
303
246
|
options
|
304
247
|
end
|
305
248
|
|
249
|
+
##
|
250
|
+
# This is the top-level run method. Everything starts from here. It
|
251
|
+
# tells each Runnable sub-class to run, and each of those are
|
252
|
+
# responsible for doing whatever they do.
|
253
|
+
#
|
254
|
+
# The overall structure of a run looks like this:
|
255
|
+
#
|
256
|
+
# Minitest.autorun
|
257
|
+
# Minitest.run(args)
|
258
|
+
# Minitest.load_plugins
|
259
|
+
# Minitest.process_args
|
260
|
+
# Minitest.init_plugins
|
261
|
+
# Minitest.__run(reporter, options)
|
262
|
+
# Runnable.runnables.each
|
263
|
+
# runnable_klass.run(reporter, options)
|
264
|
+
# self.runnable_methods.each
|
265
|
+
# self.run_one_method(self, runnable_method, reporter)
|
266
|
+
# Minitest.run_one_method(klass, runnable_method)
|
267
|
+
# klass.new(runnable_method).run
|
268
|
+
|
269
|
+
def self.run args = []
|
270
|
+
self.load_plugins unless args.delete("--no-plugins") || ENV["MT_NO_PLUGINS"]
|
271
|
+
|
272
|
+
options = process_args args
|
273
|
+
|
274
|
+
Minitest.seed = options[:seed]
|
275
|
+
srand Minitest.seed
|
276
|
+
|
277
|
+
reporter = CompositeReporter.new
|
278
|
+
reporter << SummaryReporter.new(options[:io], options)
|
279
|
+
reporter << ProgressReporter.new(options[:io], options) unless options[:quiet]
|
280
|
+
|
281
|
+
self.reporter = reporter # this makes it available to plugins
|
282
|
+
self.init_plugins options
|
283
|
+
self.reporter = nil # runnables shouldn't depend on the reporter, ever
|
284
|
+
|
285
|
+
self.parallel_executor.start if parallel_executor.respond_to?(:start)
|
286
|
+
reporter.start
|
287
|
+
begin
|
288
|
+
__run reporter, options
|
289
|
+
rescue Interrupt
|
290
|
+
warn "Interrupted. Exiting..."
|
291
|
+
end
|
292
|
+
self.parallel_executor.shutdown
|
293
|
+
|
294
|
+
# might have been removed/replaced during init_plugins:
|
295
|
+
summary = reporter.reporters.grep(SummaryReporter).first
|
296
|
+
|
297
|
+
reporter.report
|
298
|
+
|
299
|
+
return empty_run! options if summary && summary.count == 0
|
300
|
+
reporter.passed?
|
301
|
+
end
|
302
|
+
|
303
|
+
def self.empty_run! options # :nodoc:
|
304
|
+
filter = options[:filter]
|
305
|
+
return true unless filter # no filter, but nothing ran == success
|
306
|
+
|
307
|
+
warn "Nothing ran for filter: %s" % [filter]
|
308
|
+
|
309
|
+
require "did_you_mean" # soft dependency, punt if it doesn't load
|
310
|
+
|
311
|
+
ms = Runnable.runnables.flat_map(&:runnable_methods)
|
312
|
+
cs = DidYouMean::SpellChecker.new(dictionary: ms).correct filter
|
313
|
+
|
314
|
+
warn DidYouMean::Formatter.message_for cs unless cs.empty?
|
315
|
+
rescue LoadError
|
316
|
+
# do nothing
|
317
|
+
end
|
318
|
+
|
319
|
+
##
|
320
|
+
# Internal run method. Responsible for telling all Runnable
|
321
|
+
# sub-classes to run.
|
322
|
+
|
323
|
+
def self.__run reporter, options
|
324
|
+
suites = Runnable.runnables.shuffle
|
325
|
+
parallel, serial = suites.partition { |s| s.test_order == :parallel }
|
326
|
+
|
327
|
+
# If we run the parallel tests before the serial tests, the parallel tests
|
328
|
+
# could run in parallel with the serial tests. This would be bad because
|
329
|
+
# the serial tests won't lock around Reporter#record. Run the serial tests
|
330
|
+
# first, so that after they complete, the parallel tests will lock when
|
331
|
+
# recording results.
|
332
|
+
serial.map { |suite| suite.run reporter, options } +
|
333
|
+
parallel.map { |suite| suite.run reporter, options }
|
334
|
+
end
|
335
|
+
|
306
336
|
def self.filter_backtrace bt # :nodoc:
|
307
337
|
result = backtrace_filter.filter bt
|
308
338
|
result = bt.dup if result.empty?
|
@@ -957,8 +957,8 @@ class TestMinitestAssertions < Minitest::Test
|
|
957
957
|
@tc.assert_same 1, 2
|
958
958
|
end
|
959
959
|
|
960
|
-
s1 = "blah"
|
961
|
-
s2 = "blah"
|
960
|
+
s1 = +"blah"
|
961
|
+
s2 = +"blah"
|
962
962
|
|
963
963
|
assert_triggered 'Expected "blah" (oid=N) to be the same as "blah" (oid=N).' do
|
964
964
|
@tc.assert_same s1, s2
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
S7043fq9EbQdBr2AXdj92+CDwuTfHI6/Hj5FVBDULufrJaan4xUgL70Hvc6pTTeW
|
30
30
|
deKfBjgVAq7EYHu1AczzlUly
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2024-
|
32
|
+
date: 2024-06-19 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rdoc
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
|
-
rubygems_version: 3.5.
|
190
|
+
rubygems_version: 3.5.11
|
191
191
|
signing_key:
|
192
192
|
specification_version: 4
|
193
193
|
summary: minitest provides a complete suite of testing facilities supporting TDD,
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
�
|
2
|
-
|
1
|
+
�P�D���w��U_��a���:�oHf~�i0i��������}n�9�qD��_��̍�D�����t�D,�A/(fdYR8��w4v>��+,�B6����������+�Bt�v3R�0��:�
|
2
|
+
����a����wǵ�����a'Wˌ�VK�xF�i�[����E!�8mq��<�A/4�S+R��� �N7�����R%��*�T����Ľ����
|
3
|
+
��)[Z��ϵ�?�v����62����=�@I�,��u��
|