minitest-hooks 1.5.3 → 1.5.4
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
- data/CHANGELOG +4 -0
- data/MIT-LICENSE +1 -1
- data/lib/minitest/hooks/test.rb +28 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: de67ef1273481e697cf1454659ff256483dfcf0cf55859fc912cc759a29a743d
|
|
4
|
+
data.tar.gz: 7cd16abd0af796f935b7e1032959df7252087ecab02b351f9a31d747c1909b5b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0677916e0f1ed89d1a2b4096b8c2a355e4330826a3e31bef6c36a94402ee6f9e2d6da1c05fba7c3e0d7e245032dbc3042c06c33b02d2213af269d2d8cfc70bf8'
|
|
7
|
+
data.tar.gz: b2309c5fa6cca75f479b2b6857f3edc1cab7641fb90c58bcc7e6361e25ba1c37c8894853a1177a8228762e86b81fa584bbd0d1fe5781eaf505db8f9aad454793
|
data/CHANGELOG
CHANGED
data/MIT-LICENSE
CHANGED
data/lib/minitest/hooks/test.rb
CHANGED
|
@@ -49,10 +49,37 @@ module Minitest::Hooks::ClassMethods
|
|
|
49
49
|
# Unless name is NEW, return a dup singleton instance.
|
|
50
50
|
def new(name)
|
|
51
51
|
if name.equal?(NEW)
|
|
52
|
-
|
|
52
|
+
instance = super('around_all')
|
|
53
|
+
|
|
54
|
+
# Attempt to handle assertion count issues. Assertions
|
|
55
|
+
# are incremented on this instance (created once per test class), but
|
|
56
|
+
# recorded on the instance created once per test method. This forwards
|
|
57
|
+
# the assertion increment to the most recently created instance.
|
|
58
|
+
def instance.assertions
|
|
59
|
+
if @instance
|
|
60
|
+
@instance.assertions
|
|
61
|
+
else
|
|
62
|
+
super
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def instance.assertions=(v)
|
|
67
|
+
if @instance
|
|
68
|
+
@instance.assertions = v
|
|
69
|
+
else
|
|
70
|
+
super
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
return instance
|
|
53
75
|
end
|
|
54
76
|
|
|
55
77
|
instance = @instance.dup
|
|
78
|
+
# Reset the assertions for the shared instance after it is
|
|
79
|
+
# copied into the current instance, so that assertions during
|
|
80
|
+
# before_all are counted.
|
|
81
|
+
@instance.instance_variable_set(:@assertions, 0)
|
|
82
|
+
@instance.instance_variable_set(:@instance, instance)
|
|
56
83
|
instance.name = name
|
|
57
84
|
instance.failures = []
|
|
58
85
|
instance
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: minitest-hooks
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jeremy Evans
|
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
127
127
|
- !ruby/object:Gem::Version
|
|
128
128
|
version: '0'
|
|
129
129
|
requirements: []
|
|
130
|
-
rubygems_version:
|
|
130
|
+
rubygems_version: 4.0.3
|
|
131
131
|
specification_version: 4
|
|
132
132
|
summary: Around and before_all/after_all/around_all hooks for Minitest
|
|
133
133
|
test_files: []
|