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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +19 -3
- data/lib/minitest/benchmark.rb +1 -1
- data/lib/minitest/path_expander.rb +11 -4
- data/lib/minitest/test_task.rb +12 -3
- data/lib/minitest.rb +10 -5
- data/test/minitest/test_minitest_benchmark.rb +14 -0
- data.tar.gz.sig +2 -1
- metadata +7 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 507bc02dff7669be704f151c1b52970df6a625a798ba3baadbb330440f6e4401
|
|
4
|
+
data.tar.gz: 12b89c4586b899dc4a0f6317cc99a1754db5dedc468cdbd8d2ae06f40926d33e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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]
|
|
29
|
-
*
|
|
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!
|
data/lib/minitest/benchmark.rb
CHANGED
|
@@ -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
|
|
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
|
data/lib/minitest/test_task.rb
CHANGED
|
@@ -187,11 +187,16 @@ module Minitest # :nodoc:
|
|
|
187
187
|
end
|
|
188
188
|
|
|
189
189
|
def define # :nodoc:
|
|
190
|
-
desc "Run the test suite. Use
|
|
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
|
|
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.
|
|
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:
|
|
166
|
-
"
|
|
167
|
-
"
|
|
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
|
-
|
|
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.
|
|
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: '
|
|
53
|
+
version: '6.0'
|
|
54
54
|
- - "<"
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: '
|
|
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: '
|
|
63
|
+
version: '6.0'
|
|
64
64
|
- - "<"
|
|
65
65
|
- !ruby/object:Gem::Version
|
|
66
|
-
version: '
|
|
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.
|
|
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.
|
|
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
|