You need to sign in or sign up before continuing.
minitest 6.0.6 → 6.1.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 +18 -0
- data/README.rdoc +19 -10
- data/Rakefile +4 -4
- data/lib/minitest/assertions.rb +1 -1
- data/lib/minitest/bisect.rb +3 -7
- data/lib/minitest/path_expander.rb +1 -1
- data/lib/minitest/spec.rb +7 -14
- data/lib/minitest/sprint.rb +2 -2
- data/lib/minitest/test.rb +68 -10
- data/lib/minitest/test_task.rb +3 -0
- data/lib/minitest.rb +27 -7
- data/test/minitest/test_bisect.rb +16 -4
- data/test/minitest/test_minitest_test.rb +49 -24
- data/test/minitest/test_path_expander.rb +11 -0
- data.tar.gz.sig +3 -1
- metadata +14 -23
- 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: 6607046e22426386660393d2ed90040eec52f0de7d673ae680a6f66692a8ee9d
|
|
4
|
+
data.tar.gz: 4e837f96fc16256381f650e33ad388d12bffdb650308eca8d1758a8204331ab2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb4fa9c47c8981497e05fbaaf36c205dbf3161f16272a54c549aa67cdb1a80ad4a9a7d5e425fed7fce57a48faf9fdd2c8fddaf64b91f1f436bd52a5e85fb2c49
|
|
7
|
+
data.tar.gz: 6e62ca5c0b5cfff74b6e4c5829dd6fbc3da1385f830bd2736732176f8235432b295b243c9ccef248dacafce146831e0d7d0141d24db44de1c4088fbd52324140
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/History.rdoc
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
=== 6.1.0 / 2026-11-06
|
|
2
|
+
|
|
3
|
+
* 1 minor enhancement:
|
|
4
|
+
|
|
5
|
+
* Added Minitest::Test.abstract_test_case! from sexp_processor tests.
|
|
6
|
+
|
|
7
|
+
* 9 bug fixes:
|
|
8
|
+
|
|
9
|
+
* Added AI policy (=NO!) to README.rdoc.
|
|
10
|
+
* Added Minitest.installed_at_exit? to make it easier for plugins to tell if autorun has been invoked. (sferik)
|
|
11
|
+
* Added validation to -W category arg processing. (teoljungberg)
|
|
12
|
+
* Allow prism 2.0 (earlopain)
|
|
13
|
+
* Clarified in doco that runnable_methods & methods_matching are for public methods only. (koi1)
|
|
14
|
+
* FINALLY got 100% doco coverage after fighting rdoc for YEARS!
|
|
15
|
+
* Fixed RegexpError for class/method names with regex metacharacters (splattael)
|
|
16
|
+
* PathExpander / Sprint: fix loading of absolute paths. (teoljungberg)
|
|
17
|
+
* Removed ruby2_keywords delegation workaround from Spec. (teoljungberg)
|
|
18
|
+
|
|
1
19
|
=== 6.0.6 / 2026-04-30
|
|
2
20
|
|
|
3
21
|
* 2 bug fixes:
|
data/README.rdoc
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
home :: https://minite.st/
|
|
4
4
|
code :: https://github.com/minitest/minitest
|
|
5
5
|
bugs :: https://github.com/minitest/minitest/issues
|
|
6
|
-
rdoc :: https://
|
|
6
|
+
rdoc :: https://minite.st/docs/
|
|
7
7
|
clog :: https://github.com/minitest/minitest/blob/master/History.rdoc
|
|
8
8
|
emacs:: https://github.com/arthurnn/minitest-emacs
|
|
9
9
|
vim :: https://github.com/vim-test/vim-test
|
|
@@ -72,6 +72,12 @@ extract-method refactorings still apply.
|
|
|
72
72
|
* Incredibly small and fast runner, but no bells and whistles.
|
|
73
73
|
* Written by squishy human beings. Software can never be perfect. We will all eventually die.
|
|
74
74
|
|
|
75
|
+
== AI Policy:
|
|
76
|
+
|
|
77
|
+
AI is not allowed. Not in PRs, not in issues... just NO. See {my AI
|
|
78
|
+
policy}[https://zenspider.com/ruby/2026/07/my-ai-policy.html] for more
|
|
79
|
+
details. If it "smells of AI", it will be rejected.
|
|
80
|
+
|
|
75
81
|
== RATIONALE:
|
|
76
82
|
|
|
77
83
|
See design_rationale.rb to see how specs and tests work in minitest.
|
|
@@ -93,7 +99,7 @@ Given that you'd like to test the following class:
|
|
|
93
99
|
=== Unit tests
|
|
94
100
|
|
|
95
101
|
Define your tests as methods beginning with +test_+. Use
|
|
96
|
-
{assertions}[
|
|
102
|
+
{assertions}[Minitest/Assertions.html] to test for results
|
|
97
103
|
or state.
|
|
98
104
|
|
|
99
105
|
require "minitest/autorun"
|
|
@@ -118,7 +124,7 @@ or state.
|
|
|
118
124
|
|
|
119
125
|
=== Specs
|
|
120
126
|
|
|
121
|
-
Use {expectations}[
|
|
127
|
+
Use {expectations}[Minitest/Expectations.html] to check
|
|
122
128
|
results or state. They must be wrapped in a value call (eg +_+).
|
|
123
129
|
|
|
124
130
|
require "minitest/autorun"
|
|
@@ -148,7 +154,7 @@ For matchers support check out:
|
|
|
148
154
|
|
|
149
155
|
=== Benchmarks
|
|
150
156
|
|
|
151
|
-
Add {benchmarks}[
|
|
157
|
+
Add {benchmarks}[Minitest/Benchmark.html] to your tests.
|
|
152
158
|
|
|
153
159
|
# optionally run benchmarks, good for CI-only work!
|
|
154
160
|
require "minitest/benchmark" if ENV["BENCH"]
|
|
@@ -250,12 +256,13 @@ There are a bunch of variables you can supply to rake to modify the run.
|
|
|
250
256
|
|
|
251
257
|
MT_LIB_EXTRAS :: Extra libs to dynamically override/inject for custom runs.
|
|
252
258
|
N :: -n: Tests to run (string or /regexp/).
|
|
259
|
+
I :: -i: Tests to include (alias for N).
|
|
253
260
|
X :: -x: Tests to exclude (string or /regexp/).
|
|
254
261
|
A :: Any extra arguments. Honors shell quoting.
|
|
255
|
-
MT_CPU :: How many threads to use for parallel test runs
|
|
262
|
+
MT_CPU :: How many threads to use for parallel test runs.
|
|
256
263
|
SEED :: -s --seed Sets random seed.
|
|
257
|
-
TESTOPTS :: Deprecated, same as A
|
|
258
|
-
FILTER :: Deprecated, same as A
|
|
264
|
+
TESTOPTS :: Deprecated, same as A.
|
|
265
|
+
FILTER :: Deprecated, same as A.
|
|
259
266
|
|
|
260
267
|
== Writing Extensions
|
|
261
268
|
|
|
@@ -358,9 +365,11 @@ Current versions of ruby: (https://endoflife.date/ruby)
|
|
|
358
365
|
|
|
359
366
|
| ruby | Status | EOL Date |
|
|
360
367
|
|------+---------+------------|
|
|
361
|
-
|
|
|
362
|
-
|
|
|
363
|
-
| 3.
|
|
368
|
+
| 4.1 | (Next) | 2030-03-31 |
|
|
369
|
+
| 4.0 | Current | 2029-03-31 |
|
|
370
|
+
| 3.4 | Maint | 2028-03-31 |
|
|
371
|
+
| 3.3 | Security| 2027-03-31 |
|
|
372
|
+
| 3.2 | EOL | 2026-03-31 |
|
|
364
373
|
| 3.1 | EOL | 2025-03-31 |
|
|
365
374
|
| 3.0 | EOL | 2024-03-31 |
|
|
366
375
|
| 2.7 | EOL | 2023-03-31 |
|
data/Rakefile
CHANGED
|
@@ -6,7 +6,7 @@ $:.unshift "lib" # to pick up lib/minitest/test_task.rb when minitest not instal
|
|
|
6
6
|
Hoe.plugin :seattlerb
|
|
7
7
|
Hoe.plugin :isolate
|
|
8
8
|
Hoe.plugin :rdoc
|
|
9
|
-
Hoe.plugin :cov
|
|
9
|
+
Hoe.plugin :cov if ENV["COV"]
|
|
10
10
|
|
|
11
11
|
Hoe.spec "minitest" do
|
|
12
12
|
developer "Ryan Davis", "ryand-ruby@zenspider.com"
|
|
@@ -15,12 +15,12 @@ Hoe.spec "minitest" do
|
|
|
15
15
|
|
|
16
16
|
require_ruby_version ">= 3.2"
|
|
17
17
|
|
|
18
|
-
dependency "prism", "
|
|
18
|
+
dependency "prism", [">= 1.5", "< 3"]
|
|
19
19
|
dependency "drb", "~> 2.0"
|
|
20
20
|
|
|
21
|
-
self.rdoc_locations << "l:/home/www/minite.st/
|
|
21
|
+
self.rdoc_locations << "l:/home/www/minite.st/rdoc/minitest/"
|
|
22
22
|
|
|
23
|
-
self.cov_filter = %w[ tmp ]
|
|
23
|
+
self.cov_filter = %w[ tmp ] if Hoe.plugins.include? :cov
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
desc "Find missing expectations"
|
data/lib/minitest/assertions.rb
CHANGED
|
@@ -376,7 +376,7 @@ module Minitest
|
|
|
376
376
|
assert o1.__send__(op), msg
|
|
377
377
|
end
|
|
378
378
|
|
|
379
|
-
NO_RE_MSG = "class or module required for rescue clause. Got %p"
|
|
379
|
+
NO_RE_MSG = "class or module required for rescue clause. Got %p" # :nodoc:
|
|
380
380
|
|
|
381
381
|
##
|
|
382
382
|
# Fails unless the block raises one of +exp+. Returns the
|
data/lib/minitest/bisect.rb
CHANGED
|
@@ -244,7 +244,7 @@ class Minitest::Bisect
|
|
|
244
244
|
if bad then
|
|
245
245
|
re = build_re culprits + bad
|
|
246
246
|
|
|
247
|
-
cmd += " -n
|
|
247
|
+
cmd += " -n #{re.shellescape}" if bad
|
|
248
248
|
end
|
|
249
249
|
|
|
250
250
|
if ENV["MTB_VERBOSE"].to_i >= 1 then
|
|
@@ -264,11 +264,11 @@ class Minitest::Bisect
|
|
|
264
264
|
|
|
265
265
|
bbc.each do |klass, methods|
|
|
266
266
|
methods = methods.map(&:last).flatten.uniq.map { |method|
|
|
267
|
-
|
|
267
|
+
Regexp.escape method
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
methods = methods.join "|"
|
|
271
|
-
re << /#{
|
|
271
|
+
re << /#{Regexp.escape klass}#(?:#{methods})/.to_s[7..-2] # (?-mix:...)
|
|
272
272
|
end
|
|
273
273
|
|
|
274
274
|
re = re.join("|").to_s.gsub(/-mix/, "")
|
|
@@ -276,10 +276,6 @@ class Minitest::Bisect
|
|
|
276
276
|
"/^(?:#{re})$/"
|
|
277
277
|
end
|
|
278
278
|
|
|
279
|
-
def re_escape str # :nodoc:
|
|
280
|
-
str.gsub(/([`'"!?&\[\]\(\)\{\}\|\+])/, '\\\\\1')
|
|
281
|
-
end
|
|
282
|
-
|
|
283
279
|
############################################################
|
|
284
280
|
# Server Methods:
|
|
285
281
|
|
|
@@ -63,7 +63,7 @@ class Minitest::VendoredPathExpander
|
|
|
63
63
|
}.flatten.sort.map { |s| _normalize s }
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
def _normalize(f) = Pathname.new(f).cleanpath.to_s # :nodoc:
|
|
66
|
+
def _normalize(f) = Pathname.new(f).cleanpath.to_s.delete_prefix("#{Dir.pwd}/") # :nodoc:
|
|
67
67
|
|
|
68
68
|
##
|
|
69
69
|
# Process a file into more arguments. Override this to add
|
data/lib/minitest/spec.rb
CHANGED
|
@@ -5,32 +5,25 @@ class Module # :nodoc:
|
|
|
5
5
|
block = dont_flip == :block
|
|
6
6
|
dont_flip = false if block
|
|
7
7
|
|
|
8
|
-
# https://eregon.me/blog/2021/02/13/correct-delegation-in-ruby-2-27-3.html
|
|
9
|
-
# Drop this when we can drop ruby 2.6 (aka after rails 6.1 EOL, ~2024-06)
|
|
10
|
-
kw_extra = "ruby2_keywords %p" % [new_name] if respond_to? :ruby2_keywords, true
|
|
11
|
-
|
|
12
8
|
self.class_eval <<-EOM, __FILE__, __LINE__ + 1
|
|
13
|
-
def #{new_name}
|
|
9
|
+
def #{new_name}(*args, **kws)
|
|
14
10
|
raise "Calling ##{new_name} outside of test." unless ctx
|
|
15
11
|
case
|
|
16
12
|
when #{!!dont_flip} then
|
|
17
|
-
ctx.#{meth}(target, *args)
|
|
13
|
+
ctx.#{meth}(target, *args, **kws)
|
|
18
14
|
when #{block} && Proc === target then
|
|
19
|
-
ctx.#{meth}(*args, &target)
|
|
15
|
+
ctx.#{meth}(*args, **kws, &target)
|
|
20
16
|
else
|
|
21
|
-
ctx.#{meth}(args.first, target, *args[1..-1])
|
|
17
|
+
ctx.#{meth}(args.first, target, *args[1..-1], **kws)
|
|
22
18
|
end
|
|
23
19
|
end
|
|
24
|
-
#{kw_extra}
|
|
25
20
|
EOM
|
|
26
21
|
end
|
|
27
22
|
end
|
|
28
23
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Expectation = Struct.new :target, :ctx
|
|
24
|
+
module Minitest
|
|
25
|
+
Expectation = Struct.new :target, :ctx # :nodoc:
|
|
32
26
|
end
|
|
33
|
-
# :startdoc:
|
|
34
27
|
|
|
35
28
|
##
|
|
36
29
|
# Kernel extensions for minitest
|
|
@@ -319,6 +312,6 @@ end
|
|
|
319
312
|
|
|
320
313
|
require_relative "expectations"
|
|
321
314
|
|
|
322
|
-
class Minitest::Expectation
|
|
315
|
+
class Minitest::Expectation # :nodoc:
|
|
323
316
|
include Minitest::Expectations
|
|
324
317
|
end
|
data/lib/minitest/sprint.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
$LOAD_PATH.unshift "test", "lib"
|
|
1
|
+
$LOAD_PATH.unshift "test", "lib", "."
|
|
2
2
|
|
|
3
3
|
require "simplecov" if ENV["MT_COV"] || ARGV.delete("--simplecov")
|
|
4
4
|
require_relative "autorun"
|
|
@@ -24,7 +24,7 @@ module Minitest
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
Minitest::PathExpander.new(args).process { |f|
|
|
27
|
-
require
|
|
27
|
+
require f
|
|
28
28
|
}
|
|
29
29
|
end
|
|
30
30
|
|
data/lib/minitest/test.rb
CHANGED
|
@@ -23,10 +23,37 @@ module Minitest
|
|
|
23
23
|
self.io_lock = Mutex.new
|
|
24
24
|
# :startdoc:
|
|
25
25
|
|
|
26
|
+
##
|
|
27
|
+
# Declare the current class an abstract test case that doesn't run
|
|
28
|
+
# tests except in subclasses.
|
|
29
|
+
#
|
|
30
|
+
# Example:
|
|
31
|
+
#
|
|
32
|
+
# class AbstractTestCase < Minitest::Test
|
|
33
|
+
# abstract_test_case!
|
|
34
|
+
#
|
|
35
|
+
# attr_accessor :obj
|
|
36
|
+
#
|
|
37
|
+
# def test_method
|
|
38
|
+
# assert_equal 42, obj.method
|
|
39
|
+
# end
|
|
40
|
+
# end
|
|
41
|
+
#
|
|
42
|
+
# class TestConcrete < AbstractTestCase
|
|
43
|
+
# def setup = self.obj = Concrete.new
|
|
44
|
+
# end
|
|
45
|
+
|
|
46
|
+
def self.abstract_test_case! klass = self
|
|
47
|
+
extend Module.new {
|
|
48
|
+
define_method :run do |*args|
|
|
49
|
+
super(*args) unless self == klass
|
|
50
|
+
end
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
26
54
|
##
|
|
27
55
|
# Call this at the top of your tests when you absolutely
|
|
28
|
-
# positively need to have ordered tests.
|
|
29
|
-
# admitting that you suck and your tests are weak.
|
|
56
|
+
# positively need to have ordered tests.
|
|
30
57
|
|
|
31
58
|
def self.i_suck_and_my_tests_are_order_dependent!
|
|
32
59
|
class << self
|
|
@@ -36,10 +63,22 @@ module Minitest
|
|
|
36
63
|
end
|
|
37
64
|
|
|
38
65
|
##
|
|
39
|
-
# Make diffs for this Test use
|
|
40
|
-
# in assert_equal can have more details.
|
|
41
|
-
#
|
|
42
|
-
#
|
|
66
|
+
# Make diffs for this Test use +pretty_inspect+ so that diff
|
|
67
|
+
# in Assertions#assert_equal can have more details.
|
|
68
|
+
#
|
|
69
|
+
# NOTE: this is much slower than the regular inspect but much more
|
|
70
|
+
# usable for complex objects.
|
|
71
|
+
#
|
|
72
|
+
# Example:
|
|
73
|
+
#
|
|
74
|
+
# class TestBlah < Minitest::Test
|
|
75
|
+
# make_my_diffs_pretty!
|
|
76
|
+
#
|
|
77
|
+
# def test_complex_object
|
|
78
|
+
# exp = deep_complex_object
|
|
79
|
+
# assert_equal exp, obj.actual # outputs clean diff
|
|
80
|
+
# end
|
|
81
|
+
# end
|
|
43
82
|
|
|
44
83
|
def self.make_my_diffs_pretty!
|
|
45
84
|
require "pp"
|
|
@@ -50,8 +89,15 @@ module Minitest
|
|
|
50
89
|
##
|
|
51
90
|
# Call this at the top of your tests (inside the +Minitest::Test+
|
|
52
91
|
# subclass or +describe+ block) when you want to run your tests in
|
|
53
|
-
# parallel.
|
|
54
|
-
#
|
|
92
|
+
# parallel.
|
|
93
|
+
#
|
|
94
|
+
# Example:
|
|
95
|
+
#
|
|
96
|
+
# class TestZeroSideEffects < Minitest::Test
|
|
97
|
+
# parallelize_me!
|
|
98
|
+
#
|
|
99
|
+
# # ... tests ...
|
|
100
|
+
# end
|
|
55
101
|
|
|
56
102
|
def self.parallelize_me!
|
|
57
103
|
return unless Minitest.parallel_executor
|
|
@@ -60,7 +106,7 @@ module Minitest
|
|
|
60
106
|
end
|
|
61
107
|
|
|
62
108
|
##
|
|
63
|
-
# Returns all instance methods starting with "test_". Based on
|
|
109
|
+
# Returns all public instance methods starting with "test_". Based on
|
|
64
110
|
# #run_order, the methods are either sorted, randomized
|
|
65
111
|
# (default), or run in parallel.
|
|
66
112
|
|
|
@@ -79,7 +125,19 @@ module Minitest
|
|
|
79
125
|
end
|
|
80
126
|
|
|
81
127
|
##
|
|
82
|
-
# Runs a single test with setup/teardown hooks.
|
|
128
|
+
# Runs a single test with setup/teardown hooks. Override this
|
|
129
|
+
# method to customize how the test is run on a class-by-class
|
|
130
|
+
# basis.
|
|
131
|
+
#
|
|
132
|
+
# Example:
|
|
133
|
+
#
|
|
134
|
+
# class TestBlah < Minitest::Test
|
|
135
|
+
# def run
|
|
136
|
+
# Dir.chdir tmp_dir do
|
|
137
|
+
# super
|
|
138
|
+
# end
|
|
139
|
+
# end
|
|
140
|
+
# end
|
|
83
141
|
|
|
84
142
|
def run
|
|
85
143
|
time_it do
|
data/lib/minitest/test_task.rb
CHANGED
|
@@ -154,8 +154,11 @@ module Minitest # :nodoc:
|
|
|
154
154
|
#
|
|
155
155
|
# MT_LIB_EXTRAS :: Extra libs to dynamically override/inject for custom runs.
|
|
156
156
|
# N :: Tests to run (string or /regexp/).
|
|
157
|
+
# I :: Tests to include (alias for N).
|
|
157
158
|
# X :: Tests to exclude (string or /regexp/).
|
|
158
159
|
# A :: Any extra arguments. Honors shell quoting.
|
|
160
|
+
# MT_CPU :: How many threads to use for parallel test runs.
|
|
161
|
+
# SEED :: Sets random seed.
|
|
159
162
|
#
|
|
160
163
|
# Deprecated:
|
|
161
164
|
#
|
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.1.0" # :nodoc:
|
|
14
14
|
|
|
15
15
|
@@installed_at_exit ||= false
|
|
16
16
|
@@after_run = []
|
|
@@ -60,11 +60,14 @@ module Minitest
|
|
|
60
60
|
cattr_accessor :info_signal
|
|
61
61
|
self.info_signal = "INFO"
|
|
62
62
|
|
|
63
|
-
cattr_accessor :allow_fork
|
|
63
|
+
cattr_accessor :allow_fork # :nodoc:
|
|
64
64
|
self.allow_fork = false
|
|
65
65
|
|
|
66
66
|
##
|
|
67
|
-
# Registers Minitest to run at process exit
|
|
67
|
+
# Registers Minitest to run at process exit. Usually called by
|
|
68
|
+
# requiring autorun:
|
|
69
|
+
#
|
|
70
|
+
# require "minitest/autorun"
|
|
68
71
|
|
|
69
72
|
def self.autorun
|
|
70
73
|
Warning[:deprecated] = true
|
|
@@ -83,9 +86,17 @@ module Minitest
|
|
|
83
86
|
|
|
84
87
|
exit_code = Minitest.run ARGV
|
|
85
88
|
} unless @@installed_at_exit
|
|
89
|
+
|
|
86
90
|
@@installed_at_exit = true
|
|
87
91
|
end
|
|
88
92
|
|
|
93
|
+
##
|
|
94
|
+
# Returns true if Minitest.autorun has been called.
|
|
95
|
+
|
|
96
|
+
def self.installed_at_exit?
|
|
97
|
+
@@installed_at_exit
|
|
98
|
+
end
|
|
99
|
+
|
|
89
100
|
##
|
|
90
101
|
# A simple hook allowing you to run a block of code after everything
|
|
91
102
|
# is done running. Eg:
|
|
@@ -218,7 +229,7 @@ module Minitest
|
|
|
218
229
|
options[:skip] = s.chars.to_a
|
|
219
230
|
end
|
|
220
231
|
|
|
221
|
-
opts.on "-W[error]", String, "Turn Ruby warnings into errors" do |s|
|
|
232
|
+
opts.on "-W[<error>]", String, "Turn Ruby warnings into errors." do |s|
|
|
222
233
|
options[:Werror] = true
|
|
223
234
|
case s
|
|
224
235
|
when "error", "all", nil then
|
|
@@ -226,7 +237,13 @@ module Minitest
|
|
|
226
237
|
$VERBOSE = true
|
|
227
238
|
::Warning[:deprecated] = true
|
|
228
239
|
else
|
|
229
|
-
::Warning
|
|
240
|
+
if ::Warning.categories.include? s.to_sym then
|
|
241
|
+
::Warning[s.to_sym] = true
|
|
242
|
+
else
|
|
243
|
+
warn "Unknown warning category: %p" % [s]
|
|
244
|
+
warn "Known categories: %s" % [::Warning.categories.join(", ")]
|
|
245
|
+
exit!
|
|
246
|
+
end
|
|
230
247
|
end
|
|
231
248
|
end
|
|
232
249
|
|
|
@@ -295,6 +312,9 @@ module Minitest
|
|
|
295
312
|
# filtered_methods.each |runnable_method|
|
|
296
313
|
# runnable_klass.run(self, runnable_method, reporter)
|
|
297
314
|
# runnable_klass.new(runnable_method).run
|
|
315
|
+
#
|
|
316
|
+
# See also:
|
|
317
|
+
# * Minitest::Test#run
|
|
298
318
|
|
|
299
319
|
def self.run args = []
|
|
300
320
|
options = process_args args
|
|
@@ -414,7 +434,7 @@ module Minitest
|
|
|
414
434
|
end
|
|
415
435
|
|
|
416
436
|
##
|
|
417
|
-
# Returns all instance methods matching the pattern +re+.
|
|
437
|
+
# Returns all public instance methods matching the pattern +re+.
|
|
418
438
|
|
|
419
439
|
def self.methods_matching re
|
|
420
440
|
public_instance_methods(true).grep(re).map(&:to_s)
|
|
@@ -479,7 +499,7 @@ module Minitest
|
|
|
479
499
|
# Runs a single method and has the reporter record the result.
|
|
480
500
|
# This was considered internal API but is factored out of run so
|
|
481
501
|
# that subclasses can specialize the running of an individual
|
|
482
|
-
# test.
|
|
502
|
+
# test.
|
|
483
503
|
|
|
484
504
|
def Runnable.run klass, method_name, reporter
|
|
485
505
|
reporter.prerecord klass, method_name
|
|
@@ -44,7 +44,7 @@ class TestMinitest::TestBisect < Minitest::Test
|
|
|
44
44
|
cul = []
|
|
45
45
|
bad = %w[A#test_1 B#test_2]
|
|
46
46
|
|
|
47
|
-
exp = "cmd -n
|
|
47
|
+
exp = "cmd -n #{"/^(?:A#(?:test_1)|B#(?:test_2))$/".shellescape}"
|
|
48
48
|
|
|
49
49
|
assert_equal exp, bisect.build_methods_cmd(cmd, cul, bad)
|
|
50
50
|
end
|
|
@@ -54,7 +54,7 @@ class TestMinitest::TestBisect < Minitest::Test
|
|
|
54
54
|
cul = []
|
|
55
55
|
bad = %w[C#test_5 C#test_6]
|
|
56
56
|
|
|
57
|
-
exp = "cmd -n
|
|
57
|
+
exp = "cmd -n #{"/^(?:C#(?:test_5|test_6))$/".shellescape}"
|
|
58
58
|
|
|
59
59
|
assert_equal exp, bisect.build_methods_cmd(cmd, cul, bad)
|
|
60
60
|
end
|
|
@@ -67,7 +67,7 @@ class TestMinitest::TestBisect < Minitest::Test
|
|
|
67
67
|
a = "A#(?:test_1|test_2)"
|
|
68
68
|
b = "B#(?:test_3|test_4)"
|
|
69
69
|
c = "C#(?:test_5|test_6)"
|
|
70
|
-
exp = "cmd -n
|
|
70
|
+
exp = "cmd -n #{"/^(?:#{a}|#{b}|#{c})$/".shellescape}"
|
|
71
71
|
|
|
72
72
|
assert_equal exp, bisect.build_methods_cmd(cmd, cul, bad)
|
|
73
73
|
end
|
|
@@ -99,7 +99,19 @@ class TestMinitest::TestBisect < Minitest::Test
|
|
|
99
99
|
def test_build_re_method_escaping
|
|
100
100
|
bad = ["Some Class#It shouldn't care what the name is"]
|
|
101
101
|
|
|
102
|
-
exp = "/^(?:Some Class#(?:It shouldn
|
|
102
|
+
exp = "/^(?:Some\\ Class#(?:It\\ shouldn't\\ care\\ what\\ the\\ name\\ is))$/"
|
|
103
|
+
|
|
104
|
+
assert_equal exp, bisect.build_re(bad)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def test_build_re_class_escaping_repeat_operator
|
|
108
|
+
# minitest/spec context/describe names are used verbatim as the
|
|
109
|
+
# class name, so a leading "*" (eg. describe "*_special_chars") must
|
|
110
|
+
# be escaped or Regexp compilation blows up with:
|
|
111
|
+
# target of repeat operator is not specified
|
|
112
|
+
bad = ["*_special_chars#test_1"]
|
|
113
|
+
|
|
114
|
+
exp = "/^(?:\\*_special_chars#(?:test_1))$/"
|
|
103
115
|
|
|
104
116
|
assert_equal exp, bisect.build_re(bad)
|
|
105
117
|
end
|
|
@@ -18,7 +18,7 @@ class Minitest::Runnable
|
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
class
|
|
21
|
+
class TestMinitestTest < MetaMetaMetaTestCase
|
|
22
22
|
parallelize_me!
|
|
23
23
|
|
|
24
24
|
MINITEST_BASE_DIR = "./lib/minitest/mini"
|
|
@@ -49,7 +49,7 @@ class TestMinitestUnit < MetaMetaMetaTestCase
|
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
def
|
|
52
|
+
def test_filter_backtrace_all_minitest
|
|
53
53
|
bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in '__send__'"] +
|
|
54
54
|
BT_MIDDLE +
|
|
55
55
|
["#{MINITEST_BASE_DIR}/test.rb:29"])
|
|
@@ -58,7 +58,7 @@ class TestMinitestUnit < MetaMetaMetaTestCase
|
|
|
58
58
|
assert_equal ex, fu
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
def
|
|
61
|
+
def test_filter_backtrace_minitest_starts
|
|
62
62
|
bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in '__send__'"] +
|
|
63
63
|
BT_MIDDLE +
|
|
64
64
|
["#{MINITEST_BASE_DIR}/mini/test.rb:29",
|
|
@@ -115,6 +115,30 @@ class TestMinitestUnit < MetaMetaMetaTestCase
|
|
|
115
115
|
end
|
|
116
116
|
end
|
|
117
117
|
|
|
118
|
+
def test_cls_abstract_test_case!
|
|
119
|
+
abs_test_class = Class.new FakeNamedTest do
|
|
120
|
+
abstract_test_case!
|
|
121
|
+
|
|
122
|
+
define_method :test_method do
|
|
123
|
+
assert true
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
@tus = [
|
|
128
|
+
abs_test_class,
|
|
129
|
+
Class.new(abs_test_class),
|
|
130
|
+
Class.new(abs_test_class),
|
|
131
|
+
]
|
|
132
|
+
|
|
133
|
+
assert_report <<~EOM
|
|
134
|
+
..
|
|
135
|
+
|
|
136
|
+
Finished in 0.00
|
|
137
|
+
|
|
138
|
+
2 runs, 2 assertions, 0 failures, 0 errors, 0 skips
|
|
139
|
+
EOM
|
|
140
|
+
end
|
|
141
|
+
|
|
118
142
|
def test_passed_eh_teardown_good
|
|
119
143
|
test_class = Class.new FakeNamedTest do
|
|
120
144
|
def teardown; assert true; end
|
|
@@ -178,9 +202,9 @@ class TestMinitestUnit < MetaMetaMetaTestCase
|
|
|
178
202
|
def util_expand_bt bt
|
|
179
203
|
bt.map { |f| f.start_with?(".") ? File.expand_path(f) : f }
|
|
180
204
|
end
|
|
181
|
-
end
|
|
205
|
+
end # TestMinitestTest
|
|
182
206
|
|
|
183
|
-
class
|
|
207
|
+
class TestMinitestTestInherited < MetaMetaMetaTestCase
|
|
184
208
|
def with_overridden_include
|
|
185
209
|
Class.class_eval do
|
|
186
210
|
def inherited_with_hacks _klass
|
|
@@ -212,7 +236,7 @@ class TestMinitestUnitInherited < MetaMetaMetaTestCase
|
|
|
212
236
|
end
|
|
213
237
|
end
|
|
214
238
|
end
|
|
215
|
-
end
|
|
239
|
+
end # TestMinitestTestInherited
|
|
216
240
|
|
|
217
241
|
class TestMinitestRunner < MetaMetaMetaTestCase
|
|
218
242
|
# do not parallelize this suite... it just can't handle it.
|
|
@@ -693,10 +717,10 @@ class TestMinitestRunner < MetaMetaMetaTestCase
|
|
|
693
717
|
end
|
|
694
718
|
assert thread.join
|
|
695
719
|
end
|
|
696
|
-
end
|
|
720
|
+
end # TestMinitestRunner
|
|
697
721
|
|
|
698
|
-
class
|
|
699
|
-
|
|
722
|
+
class TestMinitestTestOrder < MetaMetaMetaTestCase
|
|
723
|
+
parallelize_me!
|
|
700
724
|
|
|
701
725
|
def test_before_setup
|
|
702
726
|
call_order = []
|
|
@@ -799,7 +823,7 @@ class TestMinitestUnitOrder < MetaMetaMetaTestCase
|
|
|
799
823
|
|
|
800
824
|
assert_equal expected, call_order
|
|
801
825
|
end
|
|
802
|
-
end
|
|
826
|
+
end # TestMinitestTestOrder
|
|
803
827
|
|
|
804
828
|
class BetterError < RuntimeError # like better_error w/o infecting RuntimeError
|
|
805
829
|
def set_backtrace bt
|
|
@@ -966,12 +990,10 @@ class TestMinitestRunnable < Minitest::Test
|
|
|
966
990
|
assert_equal @tc.failures, over_the_wire.failures
|
|
967
991
|
assert_equal @tc.klass, over_the_wire.klass
|
|
968
992
|
end
|
|
969
|
-
end
|
|
993
|
+
end # TestMinitestRunnable
|
|
970
994
|
|
|
971
|
-
class
|
|
972
|
-
|
|
973
|
-
# which is not threadsafe. Nearly every method in here is an
|
|
974
|
-
# assertion test so it isn't worth splitting it out further.
|
|
995
|
+
class TestMinitestTestAssertions < Minitest::Test
|
|
996
|
+
parallelize_me!
|
|
975
997
|
|
|
976
998
|
def setup
|
|
977
999
|
super
|
|
@@ -1053,31 +1075,34 @@ class TestMinitestUnitTestCase < Minitest::Test
|
|
|
1053
1075
|
shitty_test_case.i_suck_and_my_tests_are_order_dependent!
|
|
1054
1076
|
end
|
|
1055
1077
|
end
|
|
1078
|
+
end # TestMinitestAssertions
|
|
1056
1079
|
|
|
1057
|
-
|
|
1058
|
-
|
|
1080
|
+
class TestMinitestExitCode < Minitest::Test
|
|
1081
|
+
# do not parallelize this suite... it just can't handle it. This has
|
|
1082
|
+
# been minimized.
|
|
1083
|
+
def setup
|
|
1084
|
+
super
|
|
1059
1085
|
skip "windows doesn't have fork" unless Process.respond_to? :fork
|
|
1086
|
+
end
|
|
1087
|
+
|
|
1088
|
+
def test_autorun_does_not_affect_fork_success_status
|
|
1060
1089
|
Process.waitpid(fork {})
|
|
1061
1090
|
assert_equal true, $?.success?
|
|
1062
1091
|
end
|
|
1063
1092
|
|
|
1064
1093
|
def test_autorun_does_not_affect_fork_exit_status
|
|
1065
|
-
@assertion_count = 0
|
|
1066
|
-
skip "windows doesn't have fork" unless Process.respond_to? :fork
|
|
1067
1094
|
Process.waitpid(fork { exit 42 })
|
|
1068
1095
|
assert_equal 42, $?.exitstatus
|
|
1069
1096
|
end
|
|
1070
1097
|
|
|
1071
1098
|
def test_autorun_optionally_can_affect_fork_exit_status
|
|
1072
|
-
@assertion_count = 0
|
|
1073
|
-
skip "windows doesn't have fork" unless Process.respond_to? :fork
|
|
1074
1099
|
Minitest.allow_fork = true
|
|
1075
1100
|
Process.waitpid(fork { exit 42 })
|
|
1076
1101
|
refute_equal 42, $?.exitstatus
|
|
1077
1102
|
ensure
|
|
1078
1103
|
Minitest.allow_fork = false
|
|
1079
1104
|
end
|
|
1080
|
-
end
|
|
1105
|
+
end # TestMinitestExitCode
|
|
1081
1106
|
|
|
1082
1107
|
class TestMinitestGuard < Minitest::Test
|
|
1083
1108
|
parallelize_me!
|
|
@@ -1103,8 +1128,8 @@ class TestMinitestGuard < Minitest::Test
|
|
|
1103
1128
|
end
|
|
1104
1129
|
end
|
|
1105
1130
|
|
|
1106
|
-
class
|
|
1107
|
-
|
|
1131
|
+
class TestMinitestTestRecording < MetaMetaMetaTestCase
|
|
1132
|
+
parallelize_me!
|
|
1108
1133
|
|
|
1109
1134
|
def assert_run_record *expected, &block
|
|
1110
1135
|
@tu = Class.new FakeNamedTest, &block
|
|
@@ -199,6 +199,17 @@ class TestPathExpander < Minitest::Test
|
|
|
199
199
|
"42")
|
|
200
200
|
end
|
|
201
201
|
|
|
202
|
+
def test_process_args_absolute_path_with_line
|
|
203
|
+
test_args = ["#{Dir.pwd}/test/test_path_expander.rb:10"]
|
|
204
|
+
test_expander = Minitest::PathExpander.new test_args
|
|
205
|
+
|
|
206
|
+
files, flags = test_expander.process_args
|
|
207
|
+
|
|
208
|
+
assert_equal %w[test/test_path_expander.rb], files
|
|
209
|
+
assert_equal [], flags
|
|
210
|
+
assert_equal({ "test/test_path_expander.rb" => [10] }, test_expander.by_line)
|
|
211
|
+
end
|
|
212
|
+
|
|
202
213
|
def test_process_args_root
|
|
203
214
|
assert_process_args(%w[],
|
|
204
215
|
%w[-n /./],
|
data.tar.gz.sig
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
�����ר~��e��n��n]��5���ea诗;b')(�'�"����Lm�p�i���8�)×nׅt��B�a�mJ�l%�Š�i��;�4XC�v�G{H��
|
|
2
|
+
�������.W�E�L��ͧ�w�2�G�H����ri_ٚu�P���z��!�����Fܪ��.��E;�Qh#�Rf밊 ��D8Cr�M���C�ݳ��l��M-P���߃�`&�_
|
|
3
|
+
��Iz��U�B�!^���E�����a�
|
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.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Davis
|
|
@@ -34,16 +34,22 @@ dependencies:
|
|
|
34
34
|
name: prism
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
|
-
- - "
|
|
37
|
+
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
39
|
version: '1.5'
|
|
40
|
+
- - "<"
|
|
41
|
+
- !ruby/object:Gem::Version
|
|
42
|
+
version: '3'
|
|
40
43
|
type: :runtime
|
|
41
44
|
prerelease: false
|
|
42
45
|
version_requirements: !ruby/object:Gem::Requirement
|
|
43
46
|
requirements:
|
|
44
|
-
- - "
|
|
47
|
+
- - ">="
|
|
45
48
|
- !ruby/object:Gem::Version
|
|
46
49
|
version: '1.5'
|
|
50
|
+
- - "<"
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '3'
|
|
47
53
|
- !ruby/object:Gem::Dependency
|
|
48
54
|
name: drb
|
|
49
55
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -64,34 +70,20 @@ dependencies:
|
|
|
64
70
|
requirements:
|
|
65
71
|
- - ">="
|
|
66
72
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: '
|
|
73
|
+
version: '7.0'
|
|
68
74
|
- - "<"
|
|
69
75
|
- !ruby/object:Gem::Version
|
|
70
|
-
version: '
|
|
76
|
+
version: '9'
|
|
71
77
|
type: :development
|
|
72
78
|
prerelease: false
|
|
73
79
|
version_requirements: !ruby/object:Gem::Requirement
|
|
74
80
|
requirements:
|
|
75
81
|
- - ">="
|
|
76
82
|
- !ruby/object:Gem::Version
|
|
77
|
-
version: '
|
|
83
|
+
version: '7.0'
|
|
78
84
|
- - "<"
|
|
79
85
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: '
|
|
81
|
-
- !ruby/object:Gem::Dependency
|
|
82
|
-
name: simplecov
|
|
83
|
-
requirement: !ruby/object:Gem::Requirement
|
|
84
|
-
requirements:
|
|
85
|
-
- - "~>"
|
|
86
|
-
- !ruby/object:Gem::Version
|
|
87
|
-
version: '0.21'
|
|
88
|
-
type: :development
|
|
89
|
-
prerelease: false
|
|
90
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
91
|
-
requirements:
|
|
92
|
-
- - "~>"
|
|
93
|
-
- !ruby/object:Gem::Version
|
|
94
|
-
version: '0.21'
|
|
86
|
+
version: '9'
|
|
95
87
|
- !ruby/object:Gem::Dependency
|
|
96
88
|
name: hoe
|
|
97
89
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -175,7 +167,6 @@ executables:
|
|
|
175
167
|
extensions: []
|
|
176
168
|
extra_rdoc_files:
|
|
177
169
|
- History.rdoc
|
|
178
|
-
- Manifest.txt
|
|
179
170
|
- README.rdoc
|
|
180
171
|
files:
|
|
181
172
|
- History.rdoc
|
|
@@ -226,7 +217,7 @@ metadata:
|
|
|
226
217
|
homepage_uri: https://minite.st/
|
|
227
218
|
source_code_uri: https://github.com/minitest/minitest
|
|
228
219
|
bug_tracker_uri: https://github.com/minitest/minitest/issues
|
|
229
|
-
documentation_uri: https://
|
|
220
|
+
documentation_uri: https://minite.st/docs/
|
|
230
221
|
changelog_uri: https://github.com/minitest/minitest/blob/master/History.rdoc
|
|
231
222
|
rdoc_options:
|
|
232
223
|
- "--main"
|
metadata.gz.sig
CHANGED
|
Binary file
|