mutant-minitest 0.10.0 → 0.10.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
- data/lib/mutant/integration/minitest.rb +11 -34
- data/lib/mutant/minitest/coverage.rb +8 -10
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 349b6799196d834029600114c9cc0f05da1359008118547b16c5e52bf918d3a4
|
4
|
+
data.tar.gz: bd60a0c1594e92e1a640184e8cd02ae13155aaa4f2fc1cf57de88361c8812f33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5ae30d6c70a6a07dabf7092b257dc89edea62844e2241228bec02223f194a365aff9180e843842b1892b0e42d2f43a6f03dc0d689772acf2b1bc05025697e65
|
7
|
+
data.tar.gz: f98309b462a6b7b5dbf8f069cc62b343f73ac571895e1f7c8483ed6c3c1fc49a22c323c99cc999445b423702ca62b281654580b86bab267b3ef4a434dd0e7686
|
@@ -51,13 +51,16 @@ module Mutant
|
|
51
51
|
reporter.passed?
|
52
52
|
end
|
53
53
|
|
54
|
-
#
|
54
|
+
# Parse expressions
|
55
55
|
#
|
56
|
-
# @
|
57
|
-
|
58
|
-
|
56
|
+
# @param [ExpressionParser] parser
|
57
|
+
#
|
58
|
+
# @return [Array<Expression>]
|
59
|
+
def expressions(parser)
|
60
|
+
klass.resolve_cover_expressions.map do |syntax|
|
61
|
+
parser.apply(syntax).from_right
|
62
|
+
end
|
59
63
|
end
|
60
|
-
|
61
64
|
end # TestCase
|
62
65
|
|
63
66
|
private_constant(*constants(false))
|
@@ -122,23 +125,13 @@ module Mutant
|
|
122
125
|
end
|
123
126
|
memoize :all_tests_index
|
124
127
|
|
125
|
-
# Construct test from test case
|
126
|
-
#
|
127
|
-
# @param [TestCase]
|
128
|
-
#
|
129
|
-
# @return [Test]
|
130
128
|
def construct_test(test_case)
|
131
129
|
Test.new(
|
132
|
-
id:
|
133
|
-
|
130
|
+
id: test_case.identification,
|
131
|
+
expressions: test_case.expressions(config.expression_parser)
|
134
132
|
)
|
135
133
|
end
|
136
134
|
|
137
|
-
# All minitest test cases
|
138
|
-
#
|
139
|
-
# Intentional utility method.
|
140
|
-
#
|
141
|
-
# @return [Array<TestCase>]
|
142
135
|
def all_test_cases
|
143
136
|
::Minitest::Runnable
|
144
137
|
.runnables
|
@@ -146,26 +139,10 @@ module Mutant
|
|
146
139
|
.flat_map(&method(:test_case))
|
147
140
|
end
|
148
141
|
|
149
|
-
# Test if runnable qualifies for mutation testing
|
150
|
-
#
|
151
|
-
# @param [Class]
|
152
|
-
#
|
153
|
-
# @return [Bool]
|
154
|
-
#
|
155
|
-
# ignore :reek:UtilityFunction
|
156
142
|
def allow_runnable?(klass)
|
157
|
-
!klass.equal?(::Minitest::Runnable) && klass.
|
143
|
+
!klass.equal?(::Minitest::Runnable) && klass.resolve_cover_expressions
|
158
144
|
end
|
159
145
|
|
160
|
-
# Turn a minitest runnable into its test cases
|
161
|
-
#
|
162
|
-
# Intentional utility method.
|
163
|
-
#
|
164
|
-
# @param [Object] runnable
|
165
|
-
#
|
166
|
-
# @return [Array<TestCase>]
|
167
|
-
#
|
168
|
-
# ignore :reek:UtilityFunction
|
169
146
|
def test_case(runnable)
|
170
147
|
runnable.runnable_methods.map { |method| TestCase.new(runnable, method) }
|
171
148
|
end
|
@@ -20,30 +20,28 @@ module Mutant
|
|
20
20
|
#
|
21
21
|
# @api public
|
22
22
|
def cover(expression)
|
23
|
-
|
24
|
-
fail "#{self} already declares to cover: #{@cover_expression.inspect}"
|
25
|
-
end
|
23
|
+
@cover_expressions = Set.new unless defined?(@cover_expressions)
|
26
24
|
|
27
|
-
@
|
25
|
+
@cover_expressions << expression
|
28
26
|
end
|
29
27
|
|
30
28
|
# Effective coverage expression
|
31
29
|
#
|
32
|
-
# @return [String
|
30
|
+
# @return [Set<String>]
|
33
31
|
#
|
34
32
|
# @api private
|
35
|
-
def
|
36
|
-
return @
|
33
|
+
def resolve_cover_expressions
|
34
|
+
return @cover_expressions if defined?(@cover_expressions)
|
37
35
|
|
38
|
-
|
36
|
+
try_superclass_cover_expressions
|
39
37
|
end
|
40
38
|
|
41
39
|
private
|
42
40
|
|
43
|
-
def
|
41
|
+
def try_superclass_cover_expressions
|
44
42
|
return if superclass.equal?(::Minitest::Runnable)
|
45
43
|
|
46
|
-
superclass.
|
44
|
+
superclass.resolve_cover_expressions
|
47
45
|
end
|
48
46
|
|
49
47
|
end # Coverage
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutant-minitest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.10.
|
33
|
+
version: 0.10.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.10.
|
40
|
+
version: 0.10.1
|
41
41
|
description: Minitest integration for mutant
|
42
42
|
email:
|
43
43
|
- mbj@schirp-dso.com
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
requirements: []
|
71
|
-
rubygems_version: 3.
|
71
|
+
rubygems_version: 3.1.4
|
72
72
|
signing_key:
|
73
73
|
specification_version: 4
|
74
74
|
summary: Minitest integration for mutant
|