minitest 5.18.0 → 5.22.3

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.
@@ -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 `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'"]
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 `add_exception'",
40
- "test/test_autotest.rb:62:in `test_add_exception'",
41
- "#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] +
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 `add_exception'",
48
- "test/test_autotest.rb:62:in `test_add_exception'"]
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 `__send__'"] +
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 `__send__'"] +
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"])
@@ -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 `test_this_is_non_ascii_failure_message'
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 \`test_error\'
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 \`teardown\'
294
+ FILE:LINE:in \'teardown\'
295
295
 
296
296
  1 runs, 1 assertions, 0 failures, 1 errors, 0 skips
297
297
  EOM
@@ -1089,17 +1089,27 @@ class TestMinitestUnitTestCase < Minitest::Test
1089
1089
 
1090
1090
  def test_autorun_does_not_affect_fork_success_status
1091
1091
  @assertion_count = 0
1092
- skip "windows doesn't have skip" unless Process.respond_to?(:fork)
1092
+ skip "windows doesn't have fork" unless Process.respond_to?(:fork)
1093
1093
  Process.waitpid(fork {})
1094
1094
  assert_equal true, $?.success?
1095
1095
  end
1096
1096
 
1097
1097
  def test_autorun_does_not_affect_fork_exit_status
1098
1098
  @assertion_count = 0
1099
- skip "windows doesn't have skip" unless Process.respond_to?(:fork)
1099
+ skip "windows doesn't have fork" unless Process.respond_to?(:fork)
1100
1100
  Process.waitpid(fork { exit 42 })
1101
1101
  assert_equal 42, $?.exitstatus
1102
1102
  end
1103
+
1104
+ def test_autorun_optionally_can_affect_fork_exit_status
1105
+ @assertion_count = 0
1106
+ skip "windows doesn't have fork" unless Process.respond_to?(:fork)
1107
+ Minitest.allow_fork = true
1108
+ Process.waitpid(fork { exit 42 })
1109
+ refute_equal 42, $?.exitstatus
1110
+ ensure
1111
+ Minitest.allow_fork = false
1112
+ end
1103
1113
  end
1104
1114
 
1105
1115
  class TestMinitestGuard < Minitest::Test
@@ -1251,12 +1261,12 @@ class TestMinitestUnitRecording < MetaMetaMetaTestCase
1251
1261
  Error:
1252
1262
  FakeNamedTestXX#test_method:
1253
1263
  AnError: AnError
1254
- FILE:LINE:in `test_method'
1264
+ FILE:LINE:in 'test_method'
1255
1265
 
1256
1266
  Error:
1257
1267
  FakeNamedTestXX#test_method:
1258
1268
  RuntimeError: unhandled exception
1259
- FILE:LINE:in `teardown'
1269
+ FILE:LINE:in 'teardown'
1260
1270
  "
1261
1271
 
1262
1272
  assert_equal exp.strip, normalize_output(first_reporter.results.first.to_s).strip
@@ -1270,3 +1280,96 @@ class TestMinitestUnitRecording < MetaMetaMetaTestCase
1270
1280
  end
1271
1281
  end
1272
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
@@ -26,6 +26,7 @@ class TestHoeTest < Minitest::Test
26
26
  end
27
27
 
28
28
  assert_equal MT_EXPECTED % [framework].join("; "), @tester.make_test_cmd
29
+ .sub(/ -- .+/, " -- ")
29
30
  end
30
31
 
31
32
  def test_make_test_cmd_for_minitest_prelude
@@ -42,5 +43,6 @@ class TestHoeTest < Minitest::Test
42
43
  end
43
44
 
44
45
  assert_equal MT_EXPECTED % [prelude, framework].join("; "), @tester.make_test_cmd
46
+ .sub(/ -- .+/, " -- ")
45
47
  end
46
48
  end
data.tar.gz.sig CHANGED
@@ -1 +1,2 @@
1
- ��w`׬^�Ft���X�5�*��c.%RHt~��~F�A�ƴ #7?�"ļ���Ju��Wj$�: ��J8)bx�eYʎEɆT2C�-xQ0 �.�.��ڿ�){�̯rFAt��W�& )��0{�X�s����Ps��Q�3˚�Fw,3H0GW$���1�L���I��d2g�N�_�n�I�w��lm�k&&�DV��|��t��o�$�� ̵"���kq�q��x�Ҋ�G��￰�N���
1
+ �:��� e0f ��F�1ma���#�+��Z,ڟQU��d���Wx���s���@��Θ���xJ�t��`o�ċ�j��*�س
2
+ ���"��7.�!c�8��ѝ#��#<�����h���f�ei�ĂZOh �Hc�:RH'_�7�xW�t��j�"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: 5.18.0
4
+ version: 5.22.3
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
- MIIDPjCCAiagAwIBAgIBBzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
13
+ MIIDPjCCAiagAwIBAgIBCDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
14
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
- GRYDY29tMB4XDTIzMDEwMTA3NTExN1oXDTI0MDEwMTA3NTExN1owRTETMBEGA1UE
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
- AQAkg3y+PBnBAPWdxxITm5sPHqdWQgSyCpRA20o4LTuWr8BWhSXBkfQNa7cY6fOn
26
- xyM34VPzBFbExv6XOGDfOMFBVaYTHuN9peC/5/umL7kLl+nflXzL2QA7K6LYj5Bg
27
- sM574Onr0dZDM6Vn69bzQ7rBIFDfK/OhlPzqKZad4nsdcsVH8ODCiT+ATMIZyz5K
28
- WCnNtqlyiWXI8tdTpahDgcUwfcN/oN7v4K8iU5IbLJX6HQ5DKgmKjfb6XyMth16k
29
- ROfWo9Uyp8ba/j9eVG14KkYRaLydAY1MNQk2yd3R5CGfeOpD1kttxjoypoUJ2dOG
30
- nsNBRuQJ1UfiCG97a6DNm+Fr
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: 2023-03-04 00:00:00.000000000 Z
32
+ date: 2024-03-13 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.0'
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.0'
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,6 +139,7 @@ files:
139
139
  - lib/minitest/assertions.rb
140
140
  - lib/minitest/autorun.rb
141
141
  - lib/minitest/benchmark.rb
142
+ - lib/minitest/compress.rb
142
143
  - lib/minitest/expectations.rb
143
144
  - lib/minitest/hell.rb
144
145
  - lib/minitest/mock.rb
@@ -157,12 +158,13 @@ files:
157
158
  - test/minitest/test_minitest_spec.rb
158
159
  - test/minitest/test_minitest_test.rb
159
160
  - test/minitest/test_minitest_test_task.rb
160
- homepage: https://github.com/seattlerb/minitest
161
+ homepage: https://github.com/minitest/minitest
161
162
  licenses:
162
163
  - MIT
163
164
  metadata:
164
- homepage_uri: https://github.com/seattlerb/minitest
165
- bug_tracker_uri: https://github.com/seattlerb/minitest/issues
165
+ homepage_uri: https://github.com/minitest/minitest
166
+ bug_tracker_uri: https://github.com/minitest/minitest/issues
167
+ changelog_uri: https://github.com/minitest/minitest/blob/master/History.rdoc
166
168
  post_install_message:
167
169
  rdoc_options:
168
170
  - "--main"
@@ -183,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
185
  - !ruby/object:Gem::Version
184
186
  version: '0'
185
187
  requirements: []
186
- rubygems_version: 3.4.6
188
+ rubygems_version: 3.5.3
187
189
  signing_key:
188
190
  specification_version: 4
189
191
  summary: minitest provides a complete suite of testing facilities supporting TDD,
metadata.gz.sig CHANGED
Binary file