minitest 6.0.0 → 6.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a97087937196a27ad6f45b6033d56ff9d222ed878b9916839220e93d65b6f3c4
4
- data.tar.gz: 4dcf037f192e07d46883351b5f5cd868c2c8cebb1f6715400375d08e9317bd19
3
+ metadata.gz: 507bc02dff7669be704f151c1b52970df6a625a798ba3baadbb330440f6e4401
4
+ data.tar.gz: 12b89c4586b899dc4a0f6317cc99a1754db5dedc468cdbd8d2ae06f40926d33e
5
5
  SHA512:
6
- metadata.gz: a7eabc337afee3e6326cc8362c0cbd93dd3aafbb6543f735473e81956c09f4fbfb602492bcca88609409a5cb092f3131154c2db3cf21b060e2065fa79a19f4be
7
- data.tar.gz: 87843ecc0b80e55bf4e56bee0283e985667f8b9e71b3bd27a21cf76dea64397c33c2e53accdcf11448ae7318a8e7615ebdd6aa57461b1a4ff2c4ddcb2f597d1a
6
+ metadata.gz: 4de7c54b989352c854e2b7769f9483c1b99dacb071752c419f55e82f3f714323d9294fc5820d5efa9e30baec7f5d346772b00dce72aa69d6d31a8b96cc57187c
7
+ data.tar.gz: e2b28dc14bd8caef238c4dc89007a25be3c41cc1eccaec266372c546687f2e94c3f878a4217fe1a969df21b7faef83db723ffe313cb8f850ada06682fe201875
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,19 @@
1
+ === 6.0.1 / 2025-12-26
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Added new rake task `test:fu` to Minitest::TestTask, to only run
6
+ tests with FU (focused units?) in their name. This should mostly
7
+ obviate the need for the minitest-focus plugin.
8
+
9
+ * 5 bug fixes:
10
+
11
+ * Fixed --help and --version exiting 1. (grosser)
12
+ * Fixed method signature of Minitest::Benchmark.run. (flavorjones)
13
+ * Flush stdout/stderr before exit./bin/minitest -Ilib ./bug1046.rb:1 < /dev/null (grosser)
14
+ * Improved usage banner output by reordering and reformatting.
15
+ * Normalize paths while processing file.rb:line args.
16
+
1
17
  === 6.0.0 / 2025-12-17
2
18
 
3
19
  This is a major release. Read this.
@@ -24,9 +40,9 @@ Oh god... here we go... (again)
24
40
  * Runnable.run -> Runnable.run_suite & Runnable.filter_runnable_methods
25
41
  * Runnable.run_one_method -> Runnable.run
26
42
  * Removed Minitest.run_one_method (might bring it back to raise?)
27
- * Removed deprecated ENV["N"] to specify number of parallel tests. Use MT_CPU.
28
- * Renamed options[:filter] to options[:include], added --include cmdline option.
29
- * --name is still handled, but that will be removed in the future.
43
+ * Removed deprecated <tt>ENV["N"]</tt> to specify number of parallel tests. Use MT_CPU.
44
+ * Renamed +options[:filter]+ to +options[:include]+, added <tt>--include</tt> cmdline option.
45
+ * <tt>--name</tt> is still handled, but that will be removed in the future.
30
46
  * Renamed Minitest::Runnable#test_order to #run_order.
31
47
  * If #message is passed a proc then that proc overrides all other output.
32
48
  * They are no longer chained!
@@ -17,7 +17,7 @@ module Minitest
17
17
  self.class.io
18
18
  end
19
19
 
20
- def self.run reporter, options = {} # :nodoc:
20
+ def self.run klass, method_name, reporter # :nodoc:
21
21
  @io = reporter.io
22
22
  super
23
23
  end
@@ -1,4 +1,5 @@
1
1
  require "prism"
2
+ require "pathname" # for ruby 3
2
3
 
3
4
  module Minitest; end # :nodoc:
4
5
 
@@ -59,9 +60,11 @@ class Minitest::VendoredPathExpander
59
60
  else
60
61
  p
61
62
  end
62
- }.flatten.sort.map { |s| s.to_s.delete_prefix "./" }
63
+ }.flatten.sort.map { |s| _normalize s }
63
64
  end
64
65
 
66
+ def _normalize(f) = Pathname.new(f).cleanpath.to_s # :nodoc:
67
+
65
68
  ##
66
69
  # Process a file into more arguments. Override this to add
67
70
  # additional capabilities.
@@ -251,8 +254,9 @@ class Minitest::PathExpander < Minitest::VendoredPathExpander
251
254
  end
252
255
  }
253
256
  next unless File.exist? f
257
+ f = _normalize f
254
258
  args << f # push path on lest it run whole dir
255
- by_line[f] = ls
259
+ by_line[f] = ls # implies rejection
256
260
  end
257
261
  }
258
262
 
@@ -287,7 +291,7 @@ class Minitest::PathExpander < Minitest::VendoredPathExpander
287
291
 
288
292
  tests = tests_by_class
289
293
 
290
- exit! if handle_missing_tests? tests
294
+ exit! 1 if handle_missing_tests? tests
291
295
 
292
296
  test_res = tests_to_regexp tests
293
297
  self.args << "-n" << "/#{test_res.join "|"}/"
@@ -364,7 +368,8 @@ class Minitest::PathExpander < Minitest::VendoredPathExpander
364
368
  puts "Did you mean?"
365
369
  puts
366
370
  l = l.begin if l.is_a? Range
367
- by_path[f]
371
+ by_path[f] and
372
+ by_path[f]
368
373
  .sort_by { |m| (m.line_s - l).abs }
369
374
  .first(2)
370
375
  .each do |m|
@@ -372,6 +377,8 @@ class Minitest::PathExpander < Minitest::VendoredPathExpander
372
377
  end
373
378
  puts
374
379
  end
380
+ $stdout.flush
381
+ $stderr.flush
375
382
  true
376
383
  end
377
384
  end
@@ -187,11 +187,16 @@ module Minitest # :nodoc:
187
187
  end
188
188
 
189
189
  def define # :nodoc:
190
- desc "Run the test suite. Use N, X, A, and TESTOPTS to add flags/args."
190
+ desc "Run the test suite. Use I, X, and A to add flags/args."
191
191
  task name do
192
192
  ruby make_test_cmd, verbose: verbose
193
193
  end
194
194
 
195
+ desc "Run the test suite, filtering for 'FU' in name (focused units?)."
196
+ task "#{name}:fu" do
197
+ ruby make_test_cmd(include:"/FU/"), verbose: verbose
198
+ end
199
+
195
200
  desc "Print out the test command. Good for profiling and other tools."
196
201
  task "#{name}:cmd" do
197
202
  puts "ruby #{make_test_cmd}"
@@ -210,7 +215,7 @@ module Minitest # :nodoc:
210
215
 
211
216
  n.threads_do tests.sort do |path|
212
217
  t0 = Time.now
213
- output = `#{Gem.ruby} #{make_test_cmd path} 2>&1`
218
+ output = `#{Gem.ruby} #{make_test_cmd path:path} 2>&1`
214
219
  t1 = Time.now - t0
215
220
 
216
221
  times[path] = t1
@@ -276,7 +281,9 @@ module Minitest # :nodoc:
276
281
  ##
277
282
  # Generate the test command-line.
278
283
 
279
- def make_test_cmd globs = test_globs
284
+ def make_test_cmd **option
285
+ globs = option[:path] || test_globs
286
+
280
287
  tests = []
281
288
  tests.concat Dir[*globs].sort.shuffle # TODO: SEED -> srand first?
282
289
  tests.map! { |f| %(require "#{f}") }
@@ -287,6 +294,8 @@ module Minitest # :nodoc:
287
294
  runner.concat tests
288
295
  runner = runner.join "; "
289
296
 
297
+ extra_args << "-i" << option[:include] if option[:include]
298
+
290
299
  args = []
291
300
  args << "-I#{libs.join File::PATH_SEPARATOR}" unless libs.empty?
292
301
  args << "-w" if warning
data/lib/minitest.rb CHANGED
@@ -10,7 +10,7 @@ require_relative "minitest/compress"
10
10
  # runtime. See +Minitest.run+ for more information.
11
11
 
12
12
  module Minitest
13
- VERSION = "6.0.0" # :nodoc:
13
+ VERSION = "6.0.1" # :nodoc:
14
14
 
15
15
  @@installed_at_exit ||= false
16
16
  @@after_run = []
@@ -162,14 +162,19 @@ module Minitest
162
162
  opts.version = Minitest::VERSION
163
163
 
164
164
  opts.banner = [
165
- "Usage: rake test [A=options] (see Minitest::TestTask for more options)",
166
- "minitest [paths] [options] (with minitest-sprint gem)",
167
- "ruby path/to/test.rb [options]\n\n",
165
+ "Usage: minitest [paths] [options]",
166
+ "ruby path/to/test.rb [options]",
167
+ "rake test [A=options] (see Minitest::TestTask for more options)\n\n",
168
168
  ].join "\n or: "
169
169
 
170
170
  opts.on "-h", "--help", "Display this help." do
171
171
  puts opts
172
- exit
172
+ exit! true
173
+ end
174
+
175
+ opts.on "-V", "--version", "Display the version." do
176
+ puts "#{opts.program_name} #{Minitest::VERSION}"
177
+ exit! true
173
178
  end
174
179
 
175
180
  desc = "Sets random seed. Also via env, eg: SEED=42"
@@ -25,6 +25,20 @@ class TestMinitestBenchmark < Minitest::Test
25
25
  assert_equal ["bench_blah"], c.runnable_methods
26
26
  end
27
27
 
28
+ def test_cls_run
29
+ c = Class.new Minitest::Benchmark do
30
+ def bench_dummy
31
+ assert true
32
+ end
33
+ end
34
+
35
+ reporter = Minitest::StatisticsReporter.new(StringIO.new(+""))
36
+
37
+ c.run c, "bench_dummy", reporter
38
+
39
+ assert_equal 1, reporter.count
40
+ end
41
+
28
42
  def test_cls_bench_range
29
43
  assert_equal [1, 10, 100, 1_000, 10_000], Minitest::Benchmark.bench_range
30
44
  end
data.tar.gz.sig CHANGED
@@ -1 +1,2 @@
1
- %4L3"t�����Eq1#��rpx0�Ȩ�}���)��JD���~cK:#ܙaJ=�͗��N� �r�����_�Xp0���K�#<�x7���u>_j?c5������Y�r����W��Q=n+����M1��~���+�pT�3�Λ֘P���;ץ Rx�t@�����'�����/L�g�����mO��b� ��1m�'��ӂq���4s� ����-�\&�۩*��Iê�!�G#�ך5s�+�!{r�>>2�߹����
1
+ o��`������]\���:���X�`��V�L�� >�>��A
2
+ Ba]E�.��F��(o:5p�85��?Q��R;]��[fQ�&�׉�T�҃U
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: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -50,20 +50,20 @@ dependencies:
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '4.0'
53
+ version: '6.0'
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
- version: '7'
56
+ version: '8'
57
57
  type: :development
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: '4.0'
63
+ version: '6.0'
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
- version: '7'
66
+ version: '8'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: simplecov
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -84,14 +84,14 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '4.3'
87
+ version: '4.5'
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '4.3'
94
+ version: '4.5'
95
95
  description: |-
96
96
  minitest provides a complete suite of testing facilities supporting
97
97
  TDD, BDD, and benchmarking.
metadata.gz.sig CHANGED
Binary file