minitest 5.22.2 → 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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/minitest/pride_plugin.rb +7 -10
- data/lib/minitest/test.rb +4 -3
- data/lib/minitest.rb +1 -1
- data/test/minitest/metametameta.rb +6 -3
- data/test/minitest/test_minitest_assertions.rb +8 -4
- data/test/minitest/test_minitest_mock.rb +2 -2
- data/test/minitest/test_minitest_reporter.rb +12 -12
- data/test/minitest/test_minitest_test.rb +16 -16
- data/test/minitest/test_minitest_test_task.rb +2 -0
- data.tar.gz.sig +2 -2
- metadata +2 -2
- 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: 549d1470d48f7424db415007d45cfd317ad88104e1e5004e97c46afa4d760a1a
|
4
|
+
data.tar.gz: f6f2e952c63cb9074d2fccf45148ab5c5045aec5bdbeadfadcbbf8338107ec2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da1e40c0087e97affdab34c247b98d5d4482ba47d3a0b677dcef4ebf0839827e304fba101a02fcebd38008a8d9ba9eaa163e98545d13927b276dcb461dac7237
|
7
|
+
data.tar.gz: c4074d137040f0362af40a5cd9c637492ba983a0a8ab5341c2acb8d531725b10192c40b6002570695aca6da1c0c1bdb389a6eac94cefcda8a6b60d48b49c960d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -113,19 +113,16 @@ module Minitest
|
|
113
113
|
#
|
114
114
|
# plot (3*sin(x)+3), (3*sin(x+2*pi/3)+3), (3*sin(x+4*pi/3)+3)
|
115
115
|
|
116
|
-
|
117
|
-
|
118
|
-
n *= 1.0 / 6
|
116
|
+
@colors = (6 * 7).times.map { |n|
|
117
|
+
n *= 1.0 / 3
|
119
118
|
r = (3 * Math.sin(n ) + 3).to_i
|
120
|
-
g = (3 * Math.sin(n +
|
121
|
-
b = (3 * Math.sin(n +
|
122
|
-
|
123
|
-
# Then we take rgb and encode them in a single number using base 6.
|
124
|
-
# For some mysterious reason, we add 16... to clear the bottom 4 bits?
|
125
|
-
# Yes... they're ugly.
|
119
|
+
g = (3 * Math.sin(n + 4 * PI_3) + 3).to_i
|
120
|
+
b = (3 * Math.sin(n + 2 * PI_3) + 3).to_i
|
126
121
|
|
122
|
+
# Then we take rgb and encode them in a single number using
|
123
|
+
# base 6, shifted by 16 for the base 16 ansi colors.
|
127
124
|
36 * r + 6 * g + b + 16
|
128
|
-
}
|
125
|
+
}.rotate(4) # puts "red" first
|
129
126
|
|
130
127
|
super
|
131
128
|
end
|
data/lib/minitest/test.rb
CHANGED
@@ -52,9 +52,10 @@ module Minitest
|
|
52
52
|
end
|
53
53
|
|
54
54
|
##
|
55
|
-
# Call this at the top of your tests
|
56
|
-
#
|
57
|
-
#
|
55
|
+
# Call this at the top of your tests (inside the +Minitest::Test+
|
56
|
+
# subclass or +describe+ block) when you want to run your tests in
|
57
|
+
# parallel. In doing so, you're admitting that you rule and your
|
58
|
+
# tests are awesome.
|
58
59
|
|
59
60
|
def self.parallelize_me!
|
60
61
|
include Minitest::Parallel::Test
|
data/lib/minitest.rb
CHANGED
@@ -960,7 +960,7 @@ module Minitest
|
|
960
960
|
# Represents run failures.
|
961
961
|
|
962
962
|
class Assertion < Exception
|
963
|
-
RE = /in
|
963
|
+
RE = /in [`'](?:[^']+[#.])?(?:assert|refute|flunk|pass|fail|raise|must|wont)/ # :nodoc:
|
964
964
|
|
965
965
|
def error # :nodoc:
|
966
966
|
self
|
@@ -110,12 +110,15 @@ class MetaMetaMetaTestCase < Minitest::Test
|
|
110
110
|
|
111
111
|
if windows? then
|
112
112
|
output.gsub!(/\[(?:[A-Za-z]:)?[^\]:]+:\d+\]/, "[FILE:LINE]")
|
113
|
-
output.gsub!(/^(\s+)(?:[A-Za-z]:)?[^:]+:\d+:in/, '\1FILE:LINE:in')
|
113
|
+
output.gsub!(/^(\s+)(?:[A-Za-z]:)?[^:]+:\d+:in [`']/, '\1FILE:LINE:in \'')
|
114
114
|
else
|
115
|
-
output.gsub!(/\[([^\]:]+):\d+\]/)
|
116
|
-
output.gsub!(/^(\s+)([^:]+):\d+:in/) { "#{$1}#{file[$2]}:LINE:in" }
|
115
|
+
output.gsub!(/\[([^\]:]+):\d+\]/) { "[#{file[$1]}:LINE]" }
|
116
|
+
output.gsub!(/^(\s+)([^:]+):\d+:in [`']/) { "#{$1}#{file[$2]}:LINE:in '" }
|
117
117
|
end
|
118
118
|
|
119
|
+
output.gsub!(/in [`']block in (?:([^']+)[#.])?/, "in 'block in")
|
120
|
+
output.gsub!(/in [`'](?:([^']+)[#.])?/, "in '")
|
121
|
+
|
119
122
|
output.gsub!(/( at )[^:]+:\d+/) { "#{$1}[#{file[$2]}:LINE]" } # eval?
|
120
123
|
|
121
124
|
output
|
@@ -762,12 +762,13 @@ class TestMinitestAssertions < Minitest::Test
|
|
762
762
|
Class: <SomeError>
|
763
763
|
Message: <\"blah\">
|
764
764
|
---Backtrace---
|
765
|
-
FILE:LINE:in
|
765
|
+
FILE:LINE:in \'block in test_assert_raises_default_triggered\'
|
766
766
|
---------------
|
767
767
|
EOM
|
768
768
|
|
769
769
|
actual = e.message.gsub(/^.+:\d+/, "FILE:LINE")
|
770
770
|
actual.gsub!(RE_LEVELS, "") unless jruby?
|
771
|
+
actual.gsub!(/[`']block in (?:TestMinitestAssertions#)?/, "'block in ")
|
771
772
|
|
772
773
|
assert_equal expected, actual
|
773
774
|
end
|
@@ -841,12 +842,13 @@ class TestMinitestAssertions < Minitest::Test
|
|
841
842
|
Class: <AnError>
|
842
843
|
Message: <\"some message\">
|
843
844
|
---Backtrace---
|
844
|
-
FILE:LINE:in
|
845
|
+
FILE:LINE:in \'block in test_assert_raises_subclass_triggered\'
|
845
846
|
---------------
|
846
847
|
EOM
|
847
848
|
|
848
849
|
actual = e.message.gsub(/^.+:\d+/, "FILE:LINE")
|
849
850
|
actual.gsub!(RE_LEVELS, "") unless jruby?
|
851
|
+
actual.gsub!(/[`']block in (?:TestMinitestAssertions#)?/, "'block in ")
|
850
852
|
|
851
853
|
assert_equal expected.chomp, actual
|
852
854
|
end
|
@@ -863,12 +865,13 @@ class TestMinitestAssertions < Minitest::Test
|
|
863
865
|
Class: <SyntaxError>
|
864
866
|
Message: <\"icky\">
|
865
867
|
---Backtrace---
|
866
|
-
FILE:LINE:in
|
868
|
+
FILE:LINE:in \'block in test_assert_raises_triggered_different\'
|
867
869
|
---------------
|
868
870
|
EOM
|
869
871
|
|
870
872
|
actual = e.message.gsub(/^.+:\d+/, "FILE:LINE")
|
871
873
|
actual.gsub!(RE_LEVELS, "") unless jruby?
|
874
|
+
actual.gsub!(/[`']block in (?:TestMinitestAssertions#)?/, "'block in ")
|
872
875
|
|
873
876
|
assert_equal expected, actual
|
874
877
|
end
|
@@ -886,12 +889,13 @@ class TestMinitestAssertions < Minitest::Test
|
|
886
889
|
Class: <SyntaxError>
|
887
890
|
Message: <\"icky\">
|
888
891
|
---Backtrace---
|
889
|
-
FILE:LINE:in
|
892
|
+
FILE:LINE:in \'block in test_assert_raises_triggered_different_msg\'
|
890
893
|
---------------
|
891
894
|
EOM
|
892
895
|
|
893
896
|
actual = e.message.gsub(/^.+:\d+/, "FILE:LINE")
|
894
897
|
actual.gsub!(RE_LEVELS, "") unless jruby?
|
898
|
+
actual.gsub!(/[`']block in (?:TestMinitestAssertions#)?/, "'block in ")
|
895
899
|
|
896
900
|
assert_equal expected.chomp, actual
|
897
901
|
end
|
@@ -728,7 +728,7 @@ class TestMinitestStub < Minitest::Test
|
|
728
728
|
end
|
729
729
|
|
730
730
|
exp = jruby? ? /Undefined method nope_nope_nope for '#{self.class}::Time'/ :
|
731
|
-
/undefined method `nope_nope_nope' for( class)?
|
731
|
+
/undefined method [`']nope_nope_nope' for( class)? [`']#{self.class}::Time'/
|
732
732
|
assert_match exp, e.message
|
733
733
|
end
|
734
734
|
|
@@ -1083,7 +1083,7 @@ class TestMinitestStub < Minitest::Test
|
|
1083
1083
|
end
|
1084
1084
|
end
|
1085
1085
|
end
|
1086
|
-
exp = /undefined method `write' for nil/
|
1086
|
+
exp = /undefined method [`']write' for nil/
|
1087
1087
|
assert_match exp, e.message
|
1088
1088
|
end
|
1089
1089
|
|
@@ -324,8 +324,8 @@ class TestMinitestReporter < MetaMetaMetaTestCase
|
|
324
324
|
1) Error:
|
325
325
|
Minitest::Test#woot:
|
326
326
|
RuntimeError: no
|
327
|
-
FILE:LINE:in
|
328
|
-
FILE:LINE:in
|
327
|
+
FILE:LINE:in 'error_test'
|
328
|
+
FILE:LINE:in 'test_report_error'
|
329
329
|
|
330
330
|
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
|
331
331
|
EOM
|
@@ -397,7 +397,7 @@ class TestMinitestReporter < MetaMetaMetaTestCase
|
|
397
397
|
def test_report_failure_uses_backtrace_filter
|
398
398
|
filter = Minitest::BacktraceFilter.new
|
399
399
|
def filter.filter _bt
|
400
|
-
["foo.rb:123:in
|
400
|
+
["foo.rb:123:in 'foo'"]
|
401
401
|
end
|
402
402
|
|
403
403
|
with_backtrace_filter filter do
|
@@ -413,15 +413,15 @@ class TestMinitestReporter < MetaMetaMetaTestCase
|
|
413
413
|
|
414
414
|
def test_report_failure_uses_backtrace_filter_complex_sorbet
|
415
415
|
backtrace = <<~EOBT
|
416
|
-
/Users/user/.gem/ruby/3.2.2/gems/minitest-5.20.0/lib/minitest/assertions.rb:183:in
|
417
|
-
example_test.rb:9:in
|
418
|
-
/Users/user/.gem/ruby/3.2.2/gems/sorbet-runtime-0.5.11068/lib/types/private/methods/call_validation.rb:256:in
|
419
|
-
/Users/user/.gem/ruby/3.2.2/gems/sorbet-runtime-0.5.11068/lib/types/private/methods/call_validation.rb:256:in
|
420
|
-
/Users/user/.gem/ruby/3.2.2/gems/sorbet-runtime-0.5.11068/lib/types/private/methods/_methods.rb:275:in
|
421
|
-
example_test.rb:25:in
|
422
|
-
/Users/user/.gem/ruby/3.2.2/gems/minitest-5.20.0/lib/minitest/test.rb:94:in
|
423
|
-
/Users/user/.gem/ruby/3.2.2/gems/minitest-5.20.0/lib/minitest/test.rb:191:in
|
424
|
-
/Users/user/.gem/ruby/3.2.2/gems/minitest-5.20.0/lib/minitest/test.rb:89:in
|
416
|
+
/Users/user/.gem/ruby/3.2.2/gems/minitest-5.20.0/lib/minitest/assertions.rb:183:in 'assert'
|
417
|
+
example_test.rb:9:in 'assert_false'
|
418
|
+
/Users/user/.gem/ruby/3.2.2/gems/sorbet-runtime-0.5.11068/lib/types/private/methods/call_validation.rb:256:in 'bind_call'
|
419
|
+
/Users/user/.gem/ruby/3.2.2/gems/sorbet-runtime-0.5.11068/lib/types/private/methods/call_validation.rb:256:in 'validate_call'
|
420
|
+
/Users/user/.gem/ruby/3.2.2/gems/sorbet-runtime-0.5.11068/lib/types/private/methods/_methods.rb:275:in 'block in _on_method_added'
|
421
|
+
example_test.rb:25:in 'test_something'
|
422
|
+
/Users/user/.gem/ruby/3.2.2/gems/minitest-5.20.0/lib/minitest/test.rb:94:in 'block (3 levels) in run'
|
423
|
+
/Users/user/.gem/ruby/3.2.2/gems/minitest-5.20.0/lib/minitest/test.rb:191:in 'capture_exceptions'
|
424
|
+
/Users/user/.gem/ruby/3.2.2/gems/minitest-5.20.0/lib/minitest/test.rb:89:in 'block (2 levels) in run'
|
425
425
|
... so many lines ...
|
426
426
|
EOBT
|
427
427
|
|
@@ -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"])
|
@@ -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
|
@@ -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
|
@@ -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,2 +1,2 @@
|
|
1
|
-
�
|
2
|
-
�
|
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.22.
|
4
|
+
version: 5.22.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
S7043fq9EbQdBr2AXdj92+CDwuTfHI6/Hj5FVBDULufrJaan4xUgL70Hvc6pTTeW
|
30
30
|
deKfBjgVAq7EYHu1AczzlUly
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2024-
|
32
|
+
date: 2024-03-13 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rdoc
|
metadata.gz.sig
CHANGED
Binary file
|