minitest 5.25.1 → 5.25.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +9 -0
- data/lib/minitest/mock.rb +3 -0
- data/lib/minitest/spec.rb +9 -8
- data/lib/minitest.rb +3 -2
- data/test/minitest/test_minitest_reporter.rb +11 -11
- data/test/minitest/test_minitest_spec.rb +17 -0
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9d178d895e1cb72094b322477fed0f7b4b5f9929bdd0d4260b034c1e8a0bd17
|
4
|
+
data.tar.gz: cdda22a6aa420566d37558cacc3a5db24765f45bc40823462dde18e7f87fa7da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65db034b716e4d5a3819b5e2cd113e9df95616955442bbedeff0905868a76c63660a78576cd3ef6a25dc4f0101d79c8af82abd48518e84ebf8f5f6c31c7ccb97
|
7
|
+
data.tar.gz: 2393a35302ceaa0b93f429c53af601b86be8abe8be02308e8a26f84f559511bf8b69ba0ee23a8a00ab77ba8aa90a600bfecbcad159b1fe0c83ddcc301b8a3938
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
=== 5.25.2 / 2024-11-21
|
2
|
+
|
3
|
+
* 4 bug fixes:
|
4
|
+
|
5
|
+
* Include class name in spec name. (thomasmarshall)
|
6
|
+
* Fixed 'redefining object_id' warning from ruby 3.4. (mattbrictson)
|
7
|
+
* Minitest top-level namespace no longer includes entire contents of README.rdoc. Too much!
|
8
|
+
* Refactored spec's describe to more cleanly determine the superclass and name
|
9
|
+
|
1
10
|
=== 5.25.1 / 2024-08-16
|
2
11
|
|
3
12
|
* 2 bug fixes:
|
data/lib/minitest/mock.rb
CHANGED
@@ -30,6 +30,7 @@ module Minitest # :nodoc:
|
|
30
30
|
end
|
31
31
|
|
32
32
|
overridden_methods.map(&:to_sym).each do |method_id|
|
33
|
+
old_w, $-w = $-w, nil
|
33
34
|
define_method method_id do |*args, **kwargs, &b|
|
34
35
|
if @expected_calls.key? method_id then
|
35
36
|
if kwargs.empty? then # FIX: drop this after 2.7 dead
|
@@ -45,6 +46,8 @@ module Minitest # :nodoc:
|
|
45
46
|
end
|
46
47
|
end
|
47
48
|
end
|
49
|
+
ensure
|
50
|
+
$-w = old_w
|
48
51
|
end
|
49
52
|
|
50
53
|
def initialize delegator = nil # :nodoc:
|
data/lib/minitest/spec.rb
CHANGED
@@ -81,14 +81,15 @@ module Kernel
|
|
81
81
|
|
82
82
|
def describe desc, *additional_desc, &block # :doc:
|
83
83
|
stack = Minitest::Spec.describe_stack
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
84
|
+
is_spec_class = Class === self && kind_of?(Minitest::Spec::DSL)
|
85
|
+
name = [stack.last, desc, *additional_desc]
|
86
|
+
name.prepend self if stack.empty? && is_spec_class
|
87
|
+
sclas =
|
88
|
+
stack.last \
|
89
|
+
|| (is_spec_class && self) \
|
90
|
+
|| Minitest::Spec.spec_type(desc, *additional_desc)
|
91
|
+
|
92
|
+
cls = sclas.create name.compact.join("::"), desc
|
92
93
|
|
93
94
|
stack.push cls
|
94
95
|
cls.class_eval(&block)
|
data/lib/minitest.rb
CHANGED
@@ -6,10 +6,11 @@ require_relative "minitest/parallel"
|
|
6
6
|
require_relative "minitest/compress"
|
7
7
|
|
8
8
|
##
|
9
|
-
#
|
9
|
+
# The top-level namespace for Minitest. Also the location of the main
|
10
|
+
# runtime. See +Minitest.run+ for more information.
|
10
11
|
|
11
12
|
module Minitest
|
12
|
-
VERSION = "5.25.
|
13
|
+
VERSION = "5.25.2" # :nodoc:
|
13
14
|
|
14
15
|
@@installed_at_exit ||= false
|
15
16
|
@@after_run = []
|
@@ -2,7 +2,7 @@ require "minitest/autorun"
|
|
2
2
|
require "minitest/metametameta"
|
3
3
|
require "forwardable"
|
4
4
|
|
5
|
-
class
|
5
|
+
class FakeTest < Minitest::Test
|
6
6
|
def woot
|
7
7
|
assert true
|
8
8
|
end
|
@@ -33,7 +33,7 @@ class TestMinitestReporter < MetaMetaMetaTestCase
|
|
33
33
|
|
34
34
|
def error_test
|
35
35
|
unless defined? @et then
|
36
|
-
@et =
|
36
|
+
@et = FakeTest.new :woot
|
37
37
|
@et.failures << Minitest::UnexpectedError.new(begin
|
38
38
|
raise "no"
|
39
39
|
rescue => e
|
@@ -56,7 +56,7 @@ class TestMinitestReporter < MetaMetaMetaTestCase
|
|
56
56
|
|
57
57
|
ex.set_backtrace ary
|
58
58
|
|
59
|
-
@sse =
|
59
|
+
@sse = FakeTest.new :woot
|
60
60
|
@sse.failures << Minitest::UnexpectedError.new(ex)
|
61
61
|
@sse = Minitest::Result.from @sse
|
62
62
|
end
|
@@ -65,7 +65,7 @@ class TestMinitestReporter < MetaMetaMetaTestCase
|
|
65
65
|
|
66
66
|
def fail_test
|
67
67
|
unless defined? @ft then
|
68
|
-
@ft =
|
68
|
+
@ft = FakeTest.new :woot
|
69
69
|
@ft.failures << begin
|
70
70
|
raise Minitest::Assertion, "boo"
|
71
71
|
rescue Minitest::Assertion => e
|
@@ -77,18 +77,18 @@ class TestMinitestReporter < MetaMetaMetaTestCase
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def passing_test
|
80
|
-
@pt ||= Minitest::Result.from
|
80
|
+
@pt ||= Minitest::Result.from FakeTest.new(:woot)
|
81
81
|
end
|
82
82
|
|
83
83
|
def passing_test_with_metadata
|
84
|
-
test =
|
84
|
+
test = FakeTest.new :woot
|
85
85
|
test.metadata[:meta] = :data
|
86
86
|
@pt ||= Minitest::Result.from test
|
87
87
|
end
|
88
88
|
|
89
89
|
def skip_test
|
90
90
|
unless defined? @st then
|
91
|
-
@st =
|
91
|
+
@st = FakeTest.new :woot
|
92
92
|
@st.failures << begin
|
93
93
|
raise Minitest::Skip
|
94
94
|
rescue Minitest::Assertion => e
|
@@ -294,7 +294,7 @@ class TestMinitestReporter < MetaMetaMetaTestCase
|
|
294
294
|
Finished in 0.00
|
295
295
|
|
296
296
|
1) Failure:
|
297
|
-
|
297
|
+
FakeTest#woot [FILE:LINE]:
|
298
298
|
boo
|
299
299
|
|
300
300
|
1 runs, 0 assertions, 1 failures, 0 errors, 0 skips
|
@@ -318,7 +318,7 @@ class TestMinitestReporter < MetaMetaMetaTestCase
|
|
318
318
|
Finished in 0.00
|
319
319
|
|
320
320
|
1) Error:
|
321
|
-
|
321
|
+
FakeTest#woot:
|
322
322
|
RuntimeError: no
|
323
323
|
FILE:LINE:in 'error_test'
|
324
324
|
FILE:LINE:in 'test_report_error'
|
@@ -344,7 +344,7 @@ class TestMinitestReporter < MetaMetaMetaTestCase
|
|
344
344
|
Finished in 0.00
|
345
345
|
|
346
346
|
1) Error:
|
347
|
-
|
347
|
+
FakeTest#woot:
|
348
348
|
SystemStackError: 274 -> 12
|
349
349
|
a
|
350
350
|
b
|
@@ -402,7 +402,7 @@ class TestMinitestReporter < MetaMetaMetaTestCase
|
|
402
402
|
r.report
|
403
403
|
end
|
404
404
|
|
405
|
-
exp = "
|
405
|
+
exp = "FakeTest#woot [foo.rb:123]"
|
406
406
|
|
407
407
|
assert_includes io.string, exp
|
408
408
|
end
|
@@ -952,6 +952,23 @@ class TestMeta < MetaMetaMetaTestCase
|
|
952
952
|
assert_equal "ExampleB::random_method", spec_b.name
|
953
953
|
end
|
954
954
|
|
955
|
+
def test_name_inside_class
|
956
|
+
spec_a = nil
|
957
|
+
spec_b = nil
|
958
|
+
inside_class_example = Class.new Minitest::Spec
|
959
|
+
Object.const_set :InsideClassExample, inside_class_example
|
960
|
+
inside_class_example.class_eval do
|
961
|
+
spec_a = describe "a" do
|
962
|
+
spec_b = describe "b" do; end
|
963
|
+
end
|
964
|
+
end
|
965
|
+
|
966
|
+
assert_equal "InsideClassExample::a", spec_a.name
|
967
|
+
assert_equal "InsideClassExample::a::b", spec_b.name
|
968
|
+
ensure
|
969
|
+
Object.send :remove_const, :InsideClassExample
|
970
|
+
end
|
971
|
+
|
955
972
|
def test_structure
|
956
973
|
x, y, z, * = util_structure
|
957
974
|
|
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.25.
|
4
|
+
version: 5.25.2
|
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-11-21 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rdoc
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
|
-
rubygems_version: 3.5.
|
190
|
+
rubygems_version: 3.5.23
|
191
191
|
signing_key:
|
192
192
|
specification_version: 4
|
193
193
|
summary: minitest provides a complete suite of testing facilities supporting TDD,
|
metadata.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
�t����_g�]g�
|