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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fda67b0990dbc1aec353c0b1871704fd2a3039ecd4af416779adbc91eadffff
4
- data.tar.gz: 43cbe0b15833cb18ff060de4e7bf6989494ddef27705eebd8f1e404c1b9b4449
3
+ metadata.gz: 349b6799196d834029600114c9cc0f05da1359008118547b16c5e52bf918d3a4
4
+ data.tar.gz: bd60a0c1594e92e1a640184e8cd02ae13155aaa4f2fc1cf57de88361c8812f33
5
5
  SHA512:
6
- metadata.gz: 8c68b958306a87efebf46972c9eee2be6ad3831ea5b90cfc676429bfe4459c5002b359166955fdee05e690c50b448e7b0adc63da0ed34b0e689469ee4752523b
7
- data.tar.gz: 7648b03e75c1af51daa55289cc9b553d305b4574b0f5dbbb6b72cc5c60815403db6afd443bc8c461003e3a3eaa86e5f1ea350e80f5dbe0aefc9fad5a9d5087ac
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
- # Cover expression syntaxes
54
+ # Parse expressions
55
55
  #
56
- # @return [String, nil]
57
- def expression_syntax
58
- klass.resolve_cover_expression
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: test_case.identification,
133
- expression: config.expression_parser.apply(test_case.expression_syntax).from_right
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.resolve_cover_expression
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
- if defined?(@cover_expression)
24
- fail "#{self} already declares to cover: #{@cover_expression.inspect}"
25
- end
23
+ @cover_expressions = Set.new unless defined?(@cover_expressions)
26
24
 
27
- @cover_expression = expression
25
+ @cover_expressions << expression
28
26
  end
29
27
 
30
28
  # Effective coverage expression
31
29
  #
32
- # @return [String, nil]
30
+ # @return [Set<String>]
33
31
  #
34
32
  # @api private
35
- def resolve_cover_expression
36
- return @cover_expression if defined?(@cover_expression)
33
+ def resolve_cover_expressions
34
+ return @cover_expressions if defined?(@cover_expressions)
37
35
 
38
- try_superclass_cover_expression
36
+ try_superclass_cover_expressions
39
37
  end
40
38
 
41
39
  private
42
40
 
43
- def try_superclass_cover_expression
41
+ def try_superclass_cover_expressions
44
42
  return if superclass.equal?(::Minitest::Runnable)
45
43
 
46
- superclass.resolve_cover_expression
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.0
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.0
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.0
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.2.0.rc.1
71
+ rubygems_version: 3.1.4
72
72
  signing_key:
73
73
  specification_version: 4
74
74
  summary: Minitest integration for mutant