minitest 5.20.0 → 5.24.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 +102 -3
- data/Manifest.txt +3 -0
- data/README.rdoc +16 -13
- data/Rakefile +6 -0
- data/lib/minitest/assertions.rb +15 -13
- data/lib/minitest/autorun.rb +0 -7
- data/lib/minitest/compress.rb +94 -0
- data/lib/minitest/error_on_warning.rb +11 -0
- data/lib/minitest/manual_plugins.rb +16 -0
- data/lib/minitest/mock.rb +4 -2
- data/lib/minitest/parallel.rb +1 -1
- data/lib/minitest/pride_plugin.rb +7 -10
- data/lib/minitest/test.rb +4 -3
- data/lib/minitest/test_task.rb +8 -3
- data/lib/minitest.rb +212 -106
- data/test/minitest/metametameta.rb +29 -12
- data/test/minitest/test_minitest_assertions.rb +50 -31
- data/test/minitest/test_minitest_mock.rb +15 -13
- data/test/minitest/test_minitest_reporter.rb +102 -3
- data/test/minitest/test_minitest_spec.rb +19 -17
- data/test/minitest/test_minitest_test.rb +114 -21
- data/test/minitest/test_minitest_test_task.rb +9 -1
- data.tar.gz.sig +0 -0
- metadata +17 -13
- metadata.gz.sig +0 -0
|
@@ -28,24 +28,24 @@ class TestMinitestUnit < MetaMetaMetaTestCase
|
|
|
28
28
|
basedir = Pathname.new(File.expand_path "lib/minitest") + "mini"
|
|
29
29
|
basedir = basedir.relative_path_from(pwd).to_s
|
|
30
30
|
MINITEST_BASE_DIR = basedir[/\A\./] ? basedir : "./#{basedir}"
|
|
31
|
-
BT_MIDDLE = ["#{MINITEST_BASE_DIR}/test.rb:161:in
|
|
32
|
-
"#{MINITEST_BASE_DIR}/test.rb:158:in
|
|
33
|
-
"#{MINITEST_BASE_DIR}/test.rb:139:in
|
|
34
|
-
"#{MINITEST_BASE_DIR}/test.rb:106:in
|
|
31
|
+
BT_MIDDLE = ["#{MINITEST_BASE_DIR}/test.rb:161:in 'each'",
|
|
32
|
+
"#{MINITEST_BASE_DIR}/test.rb:158:in 'each'",
|
|
33
|
+
"#{MINITEST_BASE_DIR}/test.rb:139:in 'run'",
|
|
34
|
+
"#{MINITEST_BASE_DIR}/test.rb:106:in 'run'"]
|
|
35
35
|
|
|
36
36
|
def test_filter_backtrace
|
|
37
37
|
# this is a semi-lame mix of relative paths.
|
|
38
38
|
# I cheated by making the autotest parts not have ./
|
|
39
|
-
bt = (["lib/autotest.rb:571:in
|
|
40
|
-
"test/test_autotest.rb:62:in
|
|
41
|
-
"#{MINITEST_BASE_DIR}/test.rb:165:in
|
|
39
|
+
bt = (["lib/autotest.rb:571:in 'add_exception'",
|
|
40
|
+
"test/test_autotest.rb:62:in 'test_add_exception'",
|
|
41
|
+
"#{MINITEST_BASE_DIR}/test.rb:165:in '__send__'"] +
|
|
42
42
|
BT_MIDDLE +
|
|
43
43
|
["#{MINITEST_BASE_DIR}/test.rb:29",
|
|
44
44
|
"test/test_autotest.rb:422"])
|
|
45
45
|
bt = util_expand_bt bt
|
|
46
46
|
|
|
47
|
-
ex = ["lib/autotest.rb:571:in
|
|
48
|
-
"test/test_autotest.rb:62:in
|
|
47
|
+
ex = ["lib/autotest.rb:571:in 'add_exception'",
|
|
48
|
+
"test/test_autotest.rb:62:in 'test_add_exception'"]
|
|
49
49
|
ex = util_expand_bt ex
|
|
50
50
|
|
|
51
51
|
Minitest::Test.io_lock.synchronize do # try not to trounce in parallel
|
|
@@ -56,7 +56,7 @@ class TestMinitestUnit < MetaMetaMetaTestCase
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def test_filter_backtrace_all_unit
|
|
59
|
-
bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in
|
|
59
|
+
bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in '__send__'"] +
|
|
60
60
|
BT_MIDDLE +
|
|
61
61
|
["#{MINITEST_BASE_DIR}/test.rb:29"])
|
|
62
62
|
ex = bt.clone
|
|
@@ -65,7 +65,7 @@ class TestMinitestUnit < MetaMetaMetaTestCase
|
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
def test_filter_backtrace_unit_starts
|
|
68
|
-
bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in
|
|
68
|
+
bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in '__send__'"] +
|
|
69
69
|
BT_MIDDLE +
|
|
70
70
|
["#{MINITEST_BASE_DIR}/mini/test.rb:29",
|
|
71
71
|
"-e:1"])
|
|
@@ -94,7 +94,7 @@ class TestMinitestUnit < MetaMetaMetaTestCase
|
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
def test_this_is_non_ascii_failure_message
|
|
97
|
-
fail 'ЁЁЁ'.force_encoding(
|
|
97
|
+
fail 'ЁЁЁ'.dup.force_encoding(Encoding::BINARY)
|
|
98
98
|
end
|
|
99
99
|
end
|
|
100
100
|
|
|
@@ -111,7 +111,7 @@ class TestMinitestUnit < MetaMetaMetaTestCase
|
|
|
111
111
|
2) Error:
|
|
112
112
|
FakeNamedTestXX#test_this_is_non_ascii_failure_message:
|
|
113
113
|
RuntimeError: ЁЁЁ
|
|
114
|
-
FILE:LINE:in
|
|
114
|
+
FILE:LINE:in 'test_this_is_non_ascii_failure_message'
|
|
115
115
|
|
|
116
116
|
2 runs, 1 assertions, 1 failures, 1 errors, 0 skips
|
|
117
117
|
EOM
|
|
@@ -263,7 +263,7 @@ class TestMinitestRunner < MetaMetaMetaTestCase
|
|
|
263
263
|
1) Error:
|
|
264
264
|
FakeNamedTestXX#test_error:
|
|
265
265
|
RuntimeError: unhandled exception
|
|
266
|
-
FILE:LINE:in
|
|
266
|
+
FILE:LINE:in \'test_error\'
|
|
267
267
|
|
|
268
268
|
2 runs, 1 assertions, 0 failures, 1 errors, 0 skips
|
|
269
269
|
EOM
|
|
@@ -291,7 +291,7 @@ class TestMinitestRunner < MetaMetaMetaTestCase
|
|
|
291
291
|
1) Error:
|
|
292
292
|
FakeNamedTestXX#test_something:
|
|
293
293
|
RuntimeError: unhandled exception
|
|
294
|
-
FILE:LINE:in
|
|
294
|
+
FILE:LINE:in \'teardown\'
|
|
295
295
|
|
|
296
296
|
1 runs, 1 assertions, 0 failures, 1 errors, 0 skips
|
|
297
297
|
EOM
|
|
@@ -1126,19 +1126,19 @@ class TestMinitestGuard < Minitest::Test
|
|
|
1126
1126
|
end
|
|
1127
1127
|
|
|
1128
1128
|
def test_rubinius_eh
|
|
1129
|
-
|
|
1129
|
+
assert_deprecation do
|
|
1130
1130
|
assert self.class.rubinius? "rbx"
|
|
1131
1131
|
end
|
|
1132
|
-
|
|
1132
|
+
assert_deprecation do
|
|
1133
1133
|
assert self.rubinius? "rbx"
|
|
1134
1134
|
end
|
|
1135
1135
|
end
|
|
1136
1136
|
|
|
1137
1137
|
def test_maglev_eh
|
|
1138
|
-
|
|
1138
|
+
assert_deprecation do
|
|
1139
1139
|
assert self.class.maglev? "maglev"
|
|
1140
1140
|
end
|
|
1141
|
-
|
|
1141
|
+
assert_deprecation do
|
|
1142
1142
|
assert self.maglev? "maglev"
|
|
1143
1143
|
end
|
|
1144
1144
|
end
|
|
@@ -1261,12 +1261,12 @@ class TestMinitestUnitRecording < MetaMetaMetaTestCase
|
|
|
1261
1261
|
Error:
|
|
1262
1262
|
FakeNamedTestXX#test_method:
|
|
1263
1263
|
AnError: AnError
|
|
1264
|
-
FILE:LINE:in
|
|
1264
|
+
FILE:LINE:in 'test_method'
|
|
1265
1265
|
|
|
1266
1266
|
Error:
|
|
1267
1267
|
FakeNamedTestXX#test_method:
|
|
1268
1268
|
RuntimeError: unhandled exception
|
|
1269
|
-
FILE:LINE:in
|
|
1269
|
+
FILE:LINE:in 'teardown'
|
|
1270
1270
|
"
|
|
1271
1271
|
|
|
1272
1272
|
assert_equal exp.strip, normalize_output(first_reporter.results.first.to_s).strip
|
|
@@ -1280,3 +1280,96 @@ class TestMinitestUnitRecording < MetaMetaMetaTestCase
|
|
|
1280
1280
|
end
|
|
1281
1281
|
end
|
|
1282
1282
|
end
|
|
1283
|
+
|
|
1284
|
+
class TestUnexpectedError < Minitest::Test
|
|
1285
|
+
def assert_compress exp, input
|
|
1286
|
+
e = Minitest::UnexpectedError.new RuntimeError.new
|
|
1287
|
+
|
|
1288
|
+
exp = exp.lines.map(&:chomp) if String === exp
|
|
1289
|
+
act = e.compress input
|
|
1290
|
+
|
|
1291
|
+
assert_equal exp, act
|
|
1292
|
+
end
|
|
1293
|
+
|
|
1294
|
+
ACT1 = %w[ a b c b c b c b c d ]
|
|
1295
|
+
|
|
1296
|
+
def test_normal
|
|
1297
|
+
assert_compress <<~EXP, %w[ a b c b c b c b c d ]
|
|
1298
|
+
a
|
|
1299
|
+
+->> 4 cycles of 2 lines:
|
|
1300
|
+
| b
|
|
1301
|
+
| c
|
|
1302
|
+
+-<<
|
|
1303
|
+
d
|
|
1304
|
+
EXP
|
|
1305
|
+
end
|
|
1306
|
+
|
|
1307
|
+
def test_normal2
|
|
1308
|
+
assert_compress <<~EXP, %w[ a b c b c b c b c ]
|
|
1309
|
+
a
|
|
1310
|
+
+->> 4 cycles of 2 lines:
|
|
1311
|
+
| b
|
|
1312
|
+
| c
|
|
1313
|
+
+-<<
|
|
1314
|
+
EXP
|
|
1315
|
+
end
|
|
1316
|
+
|
|
1317
|
+
def test_longer_c_than_b
|
|
1318
|
+
# the extra c in the front makes the overall length longer sorting it first
|
|
1319
|
+
assert_compress <<~EXP, %w[ c a b c b c b c b c b d ]
|
|
1320
|
+
c
|
|
1321
|
+
a
|
|
1322
|
+
b
|
|
1323
|
+
+->> 4 cycles of 2 lines:
|
|
1324
|
+
| c
|
|
1325
|
+
| b
|
|
1326
|
+
+-<<
|
|
1327
|
+
d
|
|
1328
|
+
EXP
|
|
1329
|
+
end
|
|
1330
|
+
|
|
1331
|
+
def test_1_line_cycles
|
|
1332
|
+
assert_compress <<~EXP, %w[ c a b c b c b c b c b b b d ]
|
|
1333
|
+
c
|
|
1334
|
+
a
|
|
1335
|
+
+->> 4 cycles of 2 lines:
|
|
1336
|
+
| b
|
|
1337
|
+
| c
|
|
1338
|
+
+-<<
|
|
1339
|
+
+->> 3 cycles of 1 lines:
|
|
1340
|
+
| b
|
|
1341
|
+
+-<<
|
|
1342
|
+
d
|
|
1343
|
+
EXP
|
|
1344
|
+
end
|
|
1345
|
+
|
|
1346
|
+
def test_sanity3
|
|
1347
|
+
pre = ("aa".."am").to_a
|
|
1348
|
+
mid = ("a".."z").to_a * 67
|
|
1349
|
+
post = ("aa".."am").to_a
|
|
1350
|
+
ary = pre + mid + post
|
|
1351
|
+
|
|
1352
|
+
exp = pre +
|
|
1353
|
+
[" +->> 67 cycles of 26 lines:"] +
|
|
1354
|
+
("a".."z").map { |s| " | #{s}" } +
|
|
1355
|
+
[" +-<<"] +
|
|
1356
|
+
post
|
|
1357
|
+
|
|
1358
|
+
assert_compress exp, ary
|
|
1359
|
+
end
|
|
1360
|
+
|
|
1361
|
+
def test_absurd_patterns
|
|
1362
|
+
assert_compress <<~EXP, %w[ a b c b c a b c b c a b c ]
|
|
1363
|
+
+->> 2 cycles of 5 lines:
|
|
1364
|
+
| a
|
|
1365
|
+
| +->> 2 cycles of 2 lines:
|
|
1366
|
+
| | b
|
|
1367
|
+
| | c
|
|
1368
|
+
| +-<<
|
|
1369
|
+
+-<<
|
|
1370
|
+
a
|
|
1371
|
+
b
|
|
1372
|
+
c
|
|
1373
|
+
EXP
|
|
1374
|
+
end
|
|
1375
|
+
end
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
require "minitest/autorun"
|
|
2
|
-
|
|
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
|
|
|
@@ -26,6 +32,7 @@ class TestHoeTest < Minitest::Test
|
|
|
26
32
|
end
|
|
27
33
|
|
|
28
34
|
assert_equal MT_EXPECTED % [framework].join("; "), @tester.make_test_cmd
|
|
35
|
+
.sub(/ -- .+/, " -- ")
|
|
29
36
|
end
|
|
30
37
|
|
|
31
38
|
def test_make_test_cmd_for_minitest_prelude
|
|
@@ -42,5 +49,6 @@ class TestHoeTest < Minitest::Test
|
|
|
42
49
|
end
|
|
43
50
|
|
|
44
51
|
assert_equal MT_EXPECTED % [prelude, framework].join("; "), @tester.make_test_cmd
|
|
52
|
+
.sub(/ -- .+/, " -- ")
|
|
45
53
|
end
|
|
46
54
|
end
|
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.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Davis
|
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
|
10
10
|
cert_chain:
|
|
11
11
|
- |
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
|
13
|
-
|
|
13
|
+
MIIDPjCCAiagAwIBAgIBCDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
|
|
14
14
|
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
|
15
|
-
|
|
15
|
+
GRYDY29tMB4XDTI0MDEwMjIxMjEyM1oXDTI1MDEwMTIxMjEyM1owRTETMBEGA1UE
|
|
16
16
|
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
|
17
17
|
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
|
18
18
|
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
|
@@ -22,14 +22,14 @@ cert_chain:
|
|
|
22
22
|
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
|
23
23
|
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
|
24
24
|
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
AQCygvpmncmkiSs9r/Kceo4bBPDszhTv6iBi4LwMReqnFrpNLMOWJw7xi8x+3eL2
|
|
26
|
+
XS09ZPNOt2zm70KmFouBMgOysnDY4k2dE8uF6B8JbZOO8QfalW+CoNBliefOTcn2
|
|
27
|
+
bg5IOP7UoGM5lC174/cbDJrJnRG9bzig5FAP0mvsgA8zgTRXQzIUAZEo92D5K7p4
|
|
28
|
+
B4/O998ho6BSOgYBI9Yk1ttdCtti6Y+8N9+fZESsjtWMykA+WXWeGUScHqiU+gH8
|
|
29
|
+
S7043fq9EbQdBr2AXdj92+CDwuTfHI6/Hj5FVBDULufrJaan4xUgL70Hvc6pTTeW
|
|
30
|
+
deKfBjgVAq7EYHu1AczzlUly
|
|
31
31
|
-----END CERTIFICATE-----
|
|
32
|
-
date:
|
|
32
|
+
date: 2024-06-29 00:00:00.000000000 Z
|
|
33
33
|
dependencies:
|
|
34
34
|
- !ruby/object:Gem::Dependency
|
|
35
35
|
name: rdoc
|
|
@@ -57,14 +57,14 @@ dependencies:
|
|
|
57
57
|
requirements:
|
|
58
58
|
- - "~>"
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '4.
|
|
60
|
+
version: '4.2'
|
|
61
61
|
type: :development
|
|
62
62
|
prerelease: false
|
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements:
|
|
65
65
|
- - "~>"
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: '4.
|
|
67
|
+
version: '4.2'
|
|
68
68
|
description: |-
|
|
69
69
|
minitest provides a complete suite of testing facilities supporting
|
|
70
70
|
TDD, BDD, mocking, and benchmarking.
|
|
@@ -139,8 +139,11 @@ files:
|
|
|
139
139
|
- lib/minitest/assertions.rb
|
|
140
140
|
- lib/minitest/autorun.rb
|
|
141
141
|
- lib/minitest/benchmark.rb
|
|
142
|
+
- lib/minitest/compress.rb
|
|
143
|
+
- lib/minitest/error_on_warning.rb
|
|
142
144
|
- lib/minitest/expectations.rb
|
|
143
145
|
- lib/minitest/hell.rb
|
|
146
|
+
- lib/minitest/manual_plugins.rb
|
|
144
147
|
- lib/minitest/mock.rb
|
|
145
148
|
- lib/minitest/parallel.rb
|
|
146
149
|
- lib/minitest/pride.rb
|
|
@@ -163,6 +166,7 @@ licenses:
|
|
|
163
166
|
metadata:
|
|
164
167
|
homepage_uri: https://github.com/minitest/minitest
|
|
165
168
|
bug_tracker_uri: https://github.com/minitest/minitest/issues
|
|
169
|
+
changelog_uri: https://github.com/minitest/minitest/blob/master/History.rdoc
|
|
166
170
|
post_install_message:
|
|
167
171
|
rdoc_options:
|
|
168
172
|
- "--main"
|
|
@@ -183,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
183
187
|
- !ruby/object:Gem::Version
|
|
184
188
|
version: '0'
|
|
185
189
|
requirements: []
|
|
186
|
-
rubygems_version: 3.
|
|
190
|
+
rubygems_version: 3.5.14
|
|
187
191
|
signing_key:
|
|
188
192
|
specification_version: 4
|
|
189
193
|
summary: minitest provides a complete suite of testing facilities supporting TDD,
|
metadata.gz.sig
CHANGED
|
Binary file
|