minitest 5.23.0 → 5.24.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 504b1223be3a95fcfafe10a397384628113ff8514e0674ade01f3db968e7c1ae
4
- data.tar.gz: 59e22fefd004b545f6084c5c91561502325add44200cc77203dbec3334746cd0
3
+ metadata.gz: ddd0fe4703c1bc82b9c33eb3dca089b234e123893d379dc940791e2cbd74802f
4
+ data.tar.gz: cfdfd1306481c0ea6ed54f03952205f4ceb9c41d2a901640f599c453eec39e39
5
5
  SHA512:
6
- metadata.gz: 5f387dcac2c6072f79ff1cb43f407bbb65f2f950785f27ec1b4a803f4ddc0200e5dd05bce956fe8d98ec10a7723c451b5e92b44b1356126657adf429ed616f59
7
- data.tar.gz: 115fa22f9991580fa4b4e98eb31c10d2b775b5de731a66e6d61f50ec14c51ac87ee25c5c038e75e5889b4845fa546bd5c5d73b8ddf1abc88322dcf5cedbce328
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:
@@ -1,10 +1,3 @@
1
- begin
2
- require "rubygems"
3
- gem "minitest"
4
- rescue Gem::LoadError
5
- # do nothing
6
- end
7
-
8
1
  require "minitest"
9
2
  require "minitest/spec"
10
3
  require "minitest/mock"
@@ -16,7 +16,7 @@ module Minitest
16
16
 
17
17
  def initialize size
18
18
  @size = size
19
- @queue = Queue.new
19
+ @queue = Thread::Queue.new
20
20
  @pool = nil
21
21
  end
22
22
 
@@ -1,6 +1,12 @@
1
1
  require "shellwords"
2
2
  require "rbconfig"
3
- require "rake/tasklib"
3
+
4
+ begin
5
+ require "rake/tasklib"
6
+ rescue LoadError => e
7
+ warn e.message
8
+ return
9
+ end
4
10
 
5
11
  module Minitest # :nodoc:
6
12
 
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.22.3" # :nodoc:
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
- def self.init_plugins options # :nodoc:
102
- self.extensions.each do |name|
103
- msg = "plugin_#{name}_init"
104
- send msg, options if self.respond_to? msg
105
- end
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 self.extensions.empty?
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
- # This is the top-level run method. Everything starts from here. It
128
- # tells each Runnable sub-class to run, and each of those are
129
- # responsible for doing whatever they do.
130
- #
131
- # The overall structure of a run looks like this:
132
- #
133
- # Minitest.autorun
134
- # Minitest.run(args)
135
- # Minitest.__run(reporter, options)
136
- # Runnable.runnables.each
137
- # runnable_klass.run(reporter, options)
138
- # self.runnable_methods.each
139
- # self.run_one_method(self, runnable_method, reporter)
140
- # Minitest.run_one_method(klass, runnable_method)
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 |meth|
275
- msg = "plugin_#{meth}_options"
276
- send msg, opts, options if self.respond_to?(msg)
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
@@ -1,5 +1,11 @@
1
1
  require "minitest/autorun"
2
- require "hoe"
2
+
3
+ begin
4
+ require "hoe"
5
+ rescue LoadError => e
6
+ warn e.message
7
+ return
8
+ end
3
9
 
4
10
  require "minitest/test_task"
5
11
 
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.23.0
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-05-15 00:00:00.000000000 Z
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.3
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
- (h��b��dv�.����l2 ��x��Wɐ��1K�Q!�Y݊��(�Χ�#ij²��}
2
- 3x�Yo>Zga�ڝ���A��_���J�9y��^�'�n��-��+Hv��؛����{3ُ�P��(otF���j��4A3m�,N��S��c���2�\�������9�Hs}:}��GyF��v������T���Y^������.N���>`�K�����$ww��^i+T�l� ��D{�����
1
+ PD��� w��U_ ��a���:�oHf~�i0i��������}n�9�qD��_��̍�D�����tD ,�A/(fdYR8��w4v>��+,�B6����������+�Btv3R�0��:�
2
+ ����a����wǵ�����a'Wˌ�VKxFi[����E!�8mq��<�A/4�S+R��� N7�����R%��*�T����Ľ����
3
+ ��)[Z��ϵ�?�v����62����=�@I�,��u��