mutant 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +7 -0
  3. data/config/flay.yml +1 -1
  4. data/config/reek.yml +1 -0
  5. data/lib/mutant.rb +10 -3
  6. data/lib/mutant/actor.rb +2 -5
  7. data/lib/mutant/actor/env.rb +1 -3
  8. data/lib/mutant/actor/mailbox.rb +2 -4
  9. data/lib/mutant/actor/receiver.rb +0 -2
  10. data/lib/mutant/actor/sender.rb +0 -1
  11. data/lib/mutant/ast.rb +22 -28
  12. data/lib/mutant/ast/meta.rb +8 -88
  13. data/lib/mutant/ast/named_children.rb +1 -8
  14. data/lib/mutant/ast/sexp.rb +0 -2
  15. data/lib/mutant/cache.rb +1 -3
  16. data/lib/mutant/cli.rb +9 -19
  17. data/lib/mutant/color.rb +0 -3
  18. data/lib/mutant/config.rb +6 -2
  19. data/lib/mutant/context.rb +2 -4
  20. data/lib/mutant/context/scope.rb +10 -16
  21. data/lib/mutant/delegator.rb +0 -3
  22. data/lib/mutant/diff.rb +8 -17
  23. data/lib/mutant/env.rb +3 -5
  24. data/lib/mutant/env/bootstrap.rb +32 -39
  25. data/lib/mutant/expression.rb +14 -132
  26. data/lib/mutant/expression/method.rb +25 -42
  27. data/lib/mutant/expression/methods.rb +17 -29
  28. data/lib/mutant/expression/namespace.rb +33 -28
  29. data/lib/mutant/expression/parser.rb +71 -0
  30. data/lib/mutant/integration.rb +17 -16
  31. data/lib/mutant/isolation.rb +14 -14
  32. data/lib/mutant/loader.rb +2 -4
  33. data/lib/mutant/matcher.rb +1 -11
  34. data/lib/mutant/matcher/chain.rb +0 -1
  35. data/lib/mutant/matcher/compiler.rb +19 -52
  36. data/lib/mutant/matcher/config.rb +65 -5
  37. data/lib/mutant/matcher/filter.rb +11 -1
  38. data/lib/mutant/matcher/method.rb +11 -21
  39. data/lib/mutant/matcher/method/instance.rb +2 -16
  40. data/lib/mutant/matcher/method/singleton.rb +3 -20
  41. data/lib/mutant/matcher/methods.rb +11 -21
  42. data/lib/mutant/matcher/namespace.rb +0 -4
  43. data/lib/mutant/matcher/null.rb +0 -1
  44. data/lib/mutant/matcher/scope.rb +0 -12
  45. data/lib/mutant/meta.rb +0 -1
  46. data/lib/mutant/meta/example.rb +12 -26
  47. data/lib/mutant/meta/example/dsl.rb +1 -8
  48. data/lib/mutant/mutation.rb +6 -14
  49. data/lib/mutant/mutator.rb +2 -14
  50. data/lib/mutant/mutator/node.rb +6 -33
  51. data/lib/mutant/mutator/node/and_asgn.rb +0 -1
  52. data/lib/mutant/mutator/node/argument.rb +0 -5
  53. data/lib/mutant/mutator/node/arguments.rb +1 -7
  54. data/lib/mutant/mutator/node/begin.rb +0 -2
  55. data/lib/mutant/mutator/node/binary.rb +0 -3
  56. data/lib/mutant/mutator/node/block.rb +0 -2
  57. data/lib/mutant/mutator/node/break.rb +0 -1
  58. data/lib/mutant/mutator/node/case.rb +0 -3
  59. data/lib/mutant/mutator/node/conditional_loop.rb +0 -1
  60. data/lib/mutant/mutator/node/const.rb +0 -1
  61. data/lib/mutant/mutator/node/define.rb +0 -1
  62. data/lib/mutant/mutator/node/defined.rb +0 -1
  63. data/lib/mutant/mutator/node/dstr.rb +0 -1
  64. data/lib/mutant/mutator/node/dsym.rb +0 -1
  65. data/lib/mutant/mutator/node/generic.rb +0 -1
  66. data/lib/mutant/mutator/node/if.rb +0 -4
  67. data/lib/mutant/mutator/node/kwbegin.rb +0 -1
  68. data/lib/mutant/mutator/node/literal/array.rb +0 -2
  69. data/lib/mutant/mutator/node/literal/boolean.rb +0 -1
  70. data/lib/mutant/mutator/node/literal/fixnum.rb +2 -5
  71. data/lib/mutant/mutator/node/literal/float.rb +1 -4
  72. data/lib/mutant/mutator/node/literal/hash.rb +0 -3
  73. data/lib/mutant/mutator/node/literal/nil.rb +0 -1
  74. data/lib/mutant/mutator/node/literal/range.rb +1 -5
  75. data/lib/mutant/mutator/node/literal/regex.rb +1 -3
  76. data/lib/mutant/mutator/node/literal/string.rb +0 -1
  77. data/lib/mutant/mutator/node/literal/symbol.rb +0 -1
  78. data/lib/mutant/mutator/node/masgn.rb +0 -1
  79. data/lib/mutant/mutator/node/match_current_line.rb +0 -1
  80. data/lib/mutant/mutator/node/mlhs.rb +0 -1
  81. data/lib/mutant/mutator/node/named_value/access.rb +0 -1
  82. data/lib/mutant/mutator/node/named_value/constant_assignment.rb +0 -2
  83. data/lib/mutant/mutator/node/named_value/variable_assignment.rb +0 -2
  84. data/lib/mutant/mutator/node/next.rb +0 -1
  85. data/lib/mutant/mutator/node/noop.rb +0 -1
  86. data/lib/mutant/mutator/node/nthref.rb +0 -1
  87. data/lib/mutant/mutator/node/op_asgn.rb +0 -1
  88. data/lib/mutant/mutator/node/or_asgn.rb +1 -2
  89. data/lib/mutant/mutator/node/resbody.rb +0 -2
  90. data/lib/mutant/mutator/node/rescue.rb +1 -6
  91. data/lib/mutant/mutator/node/return.rb +0 -1
  92. data/lib/mutant/mutator/node/send.rb +16 -17
  93. data/lib/mutant/mutator/node/send/attribute_assignment.rb +0 -3
  94. data/lib/mutant/mutator/node/send/binary.rb +0 -1
  95. data/lib/mutant/mutator/node/send/index.rb +0 -3
  96. data/lib/mutant/mutator/node/splat.rb +0 -1
  97. data/lib/mutant/mutator/node/super.rb +0 -1
  98. data/lib/mutant/mutator/node/when.rb +2 -7
  99. data/lib/mutant/mutator/node/yield.rb +0 -1
  100. data/lib/mutant/mutator/node/zsuper.rb +0 -1
  101. data/lib/mutant/mutator/registry.rb +1 -4
  102. data/lib/mutant/mutator/util.rb +0 -2
  103. data/lib/mutant/mutator/util/array.rb +0 -3
  104. data/lib/mutant/mutator/util/symbol.rb +0 -1
  105. data/lib/mutant/parallel.rb +3 -9
  106. data/lib/mutant/parallel/master.rb +7 -17
  107. data/lib/mutant/parallel/source.rb +2 -7
  108. data/lib/mutant/parallel/worker.rb +1 -5
  109. data/lib/mutant/reporter.rb +0 -4
  110. data/lib/mutant/reporter/cli.rb +1 -8
  111. data/lib/mutant/reporter/cli/format.rb +7 -18
  112. data/lib/mutant/reporter/cli/printer.rb +2 -12
  113. data/lib/mutant/reporter/cli/printer/config.rb +1 -4
  114. data/lib/mutant/reporter/cli/printer/env_progress.rb +3 -7
  115. data/lib/mutant/reporter/cli/printer/env_result.rb +0 -1
  116. data/lib/mutant/reporter/cli/printer/mutation_progress_result.rb +0 -2
  117. data/lib/mutant/reporter/cli/printer/mutation_result.rb +3 -11
  118. data/lib/mutant/reporter/cli/printer/status.rb +1 -4
  119. data/lib/mutant/reporter/cli/printer/status_progressive.rb +1 -3
  120. data/lib/mutant/reporter/cli/printer/subject_progress.rb +0 -5
  121. data/lib/mutant/reporter/cli/printer/subject_result.rb +0 -1
  122. data/lib/mutant/reporter/cli/printer/test_result.rb +0 -1
  123. data/lib/mutant/reporter/cli/tput.rb +4 -1
  124. data/lib/mutant/reporter/trace.rb +2 -4
  125. data/lib/mutant/repository.rb +88 -0
  126. data/lib/mutant/require_highjack.rb +0 -1
  127. data/lib/mutant/result.rb +25 -48
  128. data/lib/mutant/runner.rb +7 -16
  129. data/lib/mutant/runner/sink.rb +3 -11
  130. data/lib/mutant/selector.rb +1 -2
  131. data/lib/mutant/selector/expression.rb +1 -2
  132. data/lib/mutant/subject.rb +10 -21
  133. data/lib/mutant/subject/method.rb +11 -12
  134. data/lib/mutant/subject/method/instance.rb +1 -5
  135. data/lib/mutant/subject/method/singleton.rb +1 -3
  136. data/lib/mutant/test.rb +1 -2
  137. data/lib/mutant/version.rb +2 -2
  138. data/lib/mutant/warning_filter.rb +2 -7
  139. data/lib/mutant/zombifier.rb +6 -10
  140. data/meta/send.rb +8 -0
  141. data/spec/spec_helper.rb +5 -1
  142. data/spec/support/corpus.rb +5 -9
  143. data/spec/support/rb_bug.rb +0 -1
  144. data/spec/support/rspec.rb +0 -1
  145. data/spec/support/ruby_vm.rb +0 -2
  146. data/spec/unit/mutant/ast/meta/send_spec.rb +42 -0
  147. data/spec/unit/mutant/ast/named_children_spec.rb +51 -0
  148. data/spec/unit/mutant/ast/sexp_spec.rb +36 -0
  149. data/spec/unit/mutant/ast_spec.rb +8 -0
  150. data/spec/unit/mutant/cli_spec.rb +34 -19
  151. data/spec/unit/mutant/context/scope_spec.rb +11 -0
  152. data/spec/unit/mutant/env/boostrap_spec.rb +5 -2
  153. data/spec/unit/mutant/env_spec.rb +14 -15
  154. data/spec/unit/mutant/expression/method_spec.rb +10 -14
  155. data/spec/unit/mutant/expression/methods_spec.rb +24 -11
  156. data/spec/unit/mutant/expression/namespace/flat_spec.rb +5 -6
  157. data/spec/unit/mutant/expression/namespace/recursive_spec.rb +16 -10
  158. data/spec/unit/mutant/expression/parser_spec.rb +67 -0
  159. data/spec/unit/mutant/expression_spec.rb +24 -57
  160. data/spec/unit/mutant/integration/rspec_spec.rb +7 -7
  161. data/spec/unit/mutant/integration_spec.rb +2 -2
  162. data/spec/unit/mutant/isolation_spec.rb +31 -29
  163. data/spec/unit/mutant/matcher/compiler/subject_prefix_spec.rb +2 -2
  164. data/spec/unit/mutant/matcher/compiler_spec.rb +27 -58
  165. data/spec/unit/mutant/matcher/config_spec.rb +45 -0
  166. data/spec/unit/mutant/matcher/filter_spec.rb +12 -5
  167. data/spec/unit/mutant/matcher/method/instance_spec.rb +0 -1
  168. data/spec/unit/mutant/matcher/method/singleton_spec.rb +0 -1
  169. data/spec/unit/mutant/matcher/namespace_spec.rb +4 -4
  170. data/spec/unit/mutant/parallel/worker_spec.rb +1 -1
  171. data/spec/unit/mutant/reporter/cli/printer/config_spec.rb +4 -4
  172. data/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb +7 -7
  173. data/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb +2 -2
  174. data/spec/unit/mutant/reporter/cli/printer/status_progressive_spec.rb +2 -2
  175. data/spec/unit/mutant/reporter/cli/printer/status_spec.rb +12 -12
  176. data/spec/unit/mutant/reporter/cli/printer/subject_progress_spec.rb +1 -1
  177. data/spec/unit/mutant/reporter/cli_spec.rb +9 -10
  178. data/spec/unit/mutant/repository/diff_spec.rb +80 -0
  179. data/spec/unit/mutant/repository/subject_filter_spec.rb +28 -0
  180. data/spec/unit/mutant/result/env_spec.rb +1 -1
  181. data/spec/unit/mutant/runner_spec.rb +0 -1
  182. data/spec/unit/mutant/selector/expression_spec.rb +14 -14
  183. data/spec/unit/mutant/subject/method/instance_spec.rb +2 -2
  184. data/spec/unit/mutant/subject/method/singleton_spec.rb +2 -2
  185. data/spec/unit/mutant/subject_spec.rb +5 -2
  186. metadata +20 -3
  187. data/spec/support/mutation_verifier.rb +0 -96
@@ -51,7 +51,6 @@ module Mutant
51
51
  # @return [undefined]
52
52
  #
53
53
  # @api private
54
- #
55
54
  def run
56
55
  puts(mutation.identification)
57
56
  print_details
@@ -60,22 +59,20 @@ module Mutant
60
59
 
61
60
  private
62
61
 
63
- # Return details
62
+ # Print mutation details
64
63
  #
65
64
  # @return [undefined]
66
65
  #
67
66
  # @api private
68
- #
69
67
  def print_details
70
68
  __send__(MAP.fetch(mutation.class))
71
69
  end
72
70
 
73
- # Return evil details
71
+ # Evil mutation details
74
72
  #
75
73
  # @return [String]
76
74
  #
77
75
  # @api private
78
- #
79
76
  def evil_details
80
77
  diff = Diff.build(mutation.original_source, mutation.source)
81
78
  diff = color? ? diff.colorized_diff : diff.diff
@@ -91,7 +88,6 @@ module Mutant
91
88
  # @return [undefined]
92
89
  #
93
90
  # @api private
94
- #
95
91
  def print_no_diff_message
96
92
  info(
97
93
  NO_DIFF_MESSAGE,
@@ -107,7 +103,6 @@ module Mutant
107
103
  # @return [String]
108
104
  #
109
105
  # @api private
110
- #
111
106
  def noop_details
112
107
  info(NOOP_MESSAGE)
113
108
  visit_test_result
@@ -118,7 +113,6 @@ module Mutant
118
113
  # @return [String]
119
114
  #
120
115
  # @api private
121
- #
122
116
  def neutral_details
123
117
  info(NEUTRAL_MESSAGE, original_node.inspect, mutation.source)
124
118
  visit_test_result
@@ -129,17 +123,15 @@ module Mutant
129
123
  # @return [undefined]
130
124
  #
131
125
  # @api private
132
- #
133
126
  def visit_test_result
134
127
  visit(TestResult, test_result)
135
128
  end
136
129
 
137
- # Return original node
130
+ # Original node
138
131
  #
139
132
  # @return [Parser::AST::Node]
140
133
  #
141
134
  # @api private
142
- #
143
135
  def original_node
144
136
  mutation.subject.node
145
137
  end
@@ -15,7 +15,6 @@ module Mutant
15
15
  # @return [undefined]
16
16
  #
17
17
  # @api private
18
- #
19
18
  def run
20
19
  visit(EnvProgress, payload)
21
20
  job_status
@@ -30,7 +29,6 @@ module Mutant
30
29
  # @return [undefined]
31
30
  #
32
31
  # @api private
33
- #
34
32
  def job_status
35
33
  return if active_jobs.empty?
36
34
  info(ACTIVE_JOB_HEADER)
@@ -39,12 +37,11 @@ module Mutant
39
37
  end
40
38
  end
41
39
 
42
- # Return active subject results
40
+ # Active subject results
43
41
  #
44
42
  # @return [Array<Result::Subject>]
45
43
  #
46
44
  # @api private
47
- #
48
45
  def active_subject_results
49
46
  active_subjects = active_jobs.map(&:payload).flat_map(&:subject)
50
47
 
@@ -21,7 +21,6 @@ module Mutant
21
21
  # @return [undefined]
22
22
  #
23
23
  # @api private
24
- #
25
24
  def run
26
25
  status(
27
26
  FORMAT,
@@ -36,12 +35,11 @@ module Mutant
36
35
 
37
36
  private
38
37
 
39
- # Return object being printed
38
+ # Object being printed
40
39
  #
41
40
  # @return [Result::Env]
42
41
  #
43
42
  # @api private
44
- #
45
43
  def object
46
44
  super.payload
47
45
  end
@@ -23,7 +23,6 @@ module Mutant
23
23
  # @return [undefined]
24
24
  #
25
25
  # @api private
26
- #
27
26
  def run
28
27
  puts("#{subject.identification} mutations: #{amount_mutations}")
29
28
  print_mutation_results
@@ -39,7 +38,6 @@ module Mutant
39
38
  # @return [undefined]
40
39
  #
41
40
  # @api private
42
- #
43
41
  def print_stats
44
42
  status(
45
43
  FORMAT,
@@ -57,7 +55,6 @@ module Mutant
57
55
  # @return [undefined]
58
56
  #
59
57
  # @api private
60
- #
61
58
  def print_tests
62
59
  tests.each do |test|
63
60
  puts "- #{test.identification}"
@@ -69,7 +66,6 @@ module Mutant
69
66
  # @return [undefined]
70
67
  #
71
68
  # @api private
72
- #
73
69
  def print_progress_bar_finish
74
70
  puts(nil) unless amount_mutation_results.zero?
75
71
  end
@@ -79,7 +75,6 @@ module Mutant
79
75
  # @return [undefined]
80
76
  #
81
77
  # @api private
82
- #
83
78
  def print_mutation_results
84
79
  visit_collection(MutationProgressResult, object.mutation_results)
85
80
  end
@@ -12,7 +12,6 @@ module Mutant
12
12
  # @return [undefined]
13
13
  #
14
14
  # @api private
15
- #
16
15
  def run
17
16
  status(subject.identification)
18
17
  tests.each do |test|
@@ -16,7 +16,6 @@ module Mutant
16
16
  # @return [undefined]
17
17
  #
18
18
  # @api private
19
- #
20
19
  def run
21
20
  info(STATUS_FORMAT, tests.length, runtime)
22
21
  tests.each do |test|
@@ -7,13 +7,15 @@ module Mutant
7
7
 
8
8
  private_class_method :new
9
9
 
10
- # Return detected tput support
10
+ # Detected tput support
11
11
  #
12
12
  # @return [Tput]
13
13
  # if tput support is present
14
14
  #
15
15
  # @return [nil]
16
16
  # otherwise
17
+ #
18
+ # @api private
17
19
  def self.detect
18
20
  reset = capture('tput reset')
19
21
  save = capture('tput sc') if reset
@@ -33,6 +35,7 @@ module Mutant
33
35
  # @return [nil]
34
36
  # otherwise
35
37
  #
38
+ # @api private
36
39
  def self.capture(command)
37
40
  stdout, _stderr, exitstatus = Open3.capture3(command)
38
41
  stdout if exitstatus.success?
@@ -4,12 +4,11 @@ module Mutant
4
4
  class Trace
5
5
  include Adamantium::Mutable, Anima.new(:start_calls, :progress_calls, :report_calls, :warn_calls)
6
6
 
7
- # Return new trace reporter
7
+ # New trace reporter
8
8
  #
9
9
  # @return [Trace]
10
10
  #
11
11
  # @api private
12
- #
13
12
  def self.new
14
13
  super(Hash[anima.attribute_names.map { |name| [name, []] }])
15
14
  end
@@ -23,12 +22,11 @@ module Mutant
23
22
 
24
23
  REPORT_DELAY = 0.0
25
24
 
26
- # Return report delay
25
+ # Report delay
27
26
  #
28
27
  # @return [Float]
29
28
  #
30
29
  # @api private
31
- #
32
30
  def delay
33
31
  REPORT_DELAY
34
32
  end
@@ -0,0 +1,88 @@
1
+ module Mutant
2
+ module Repository
3
+ # Error raised on repository interaction problems
4
+ RepositoryError = Class.new(RuntimeError)
5
+
6
+ # Subject filter based on repository diff
7
+ class SubjectFilter
8
+ include Adamantium, Concord.new(:diff)
9
+
10
+ # Test if subject was touched in diff
11
+ #
12
+ # @param [Subject] subject
13
+ #
14
+ # @return [Boolean]
15
+ #
16
+ # @api private
17
+ def call(subject)
18
+ diff.touches?(subject.source_path, subject.source_lines)
19
+ end
20
+
21
+ end # SubjectFilter
22
+
23
+ # Diff between two objects in repository
24
+ class Diff
25
+ include Adamantium, Concord.new(:from, :to)
26
+
27
+ HEAD = 'HEAD'.freeze
28
+ private_constant(*constants(false))
29
+
30
+ # Create diff from head to revision
31
+ #
32
+ # @return [Diff]
33
+ #
34
+ # @api private
35
+ def self.from_head(to)
36
+ new(HEAD, to)
37
+ end
38
+
39
+ # Test if diff changes file at line range
40
+ #
41
+ # @param [Pathname] path
42
+ # @param [Range<Fixnum>] line_range
43
+ #
44
+ # @return [Boolean]
45
+ #
46
+ # @raise [RepositoryError]
47
+ # when git command failed
48
+ #
49
+ # @api private
50
+ def touches?(path, line_range)
51
+ return false unless tracks?(path)
52
+
53
+ command = %W[
54
+ git log
55
+ #{from}...#{to}
56
+ -L #{line_range.begin},#{line_range.end}:#{path}
57
+ ]
58
+
59
+ stdout, status = Open3.capture2(*command, binmode: true)
60
+
61
+ fail RepositoryError, "Command #{command} failed!" unless status.success?
62
+
63
+ !stdout.empty?
64
+ end
65
+
66
+ private
67
+
68
+ # Test if path is tracked in repository
69
+ #
70
+ # FIXME: Cache results, to avoid spending time on producing redundant results.
71
+ #
72
+ # @param [Pathname] path
73
+ #
74
+ # @return [Boolean]
75
+ #
76
+ # @api private
77
+ def tracks?(path)
78
+ command = %W[git ls-files --error-unmatch -- #{path}]
79
+ Kernel.system(
80
+ *command,
81
+ out: File::NULL,
82
+ err: File::NULL
83
+ )
84
+ end
85
+
86
+ end # Diff
87
+ end # Repository
88
+ end # Mutant
@@ -11,7 +11,6 @@ module Mutant
11
11
  # the original implementation on singleton
12
12
  #
13
13
  # @api private
14
- #
15
14
  def self.call(target, callback)
16
15
  target.method(:require).tap do
17
16
  target.module_eval do
@@ -4,33 +4,21 @@ module Mutant
4
4
 
5
5
  # Coverage mixin
6
6
  module Coverage
7
+ FULL_COVERAGE = Rational(1).freeze
8
+ private_constant(*constants(false))
7
9
 
8
- # Return coverage
10
+ # Observed coverage
9
11
  #
10
12
  # @return [Rational]
11
13
  #
12
14
  # @api private
13
- #
14
15
  def coverage
15
- return Rational(0) if amount_mutation_results.zero?
16
-
17
- Rational(amount_mutations_killed, amount_mutation_results)
18
- end
19
-
20
- # Hook called when module gets included
21
- #
22
- # @param [Class, Module] host
23
- #
24
- # @return [undefined]
25
- #
26
- # @api private
27
- #
28
- def self.included(host)
29
- super
30
-
31
- host.memoize(:coverage)
16
+ if amount_mutation_results.zero?
17
+ FULL_COVERAGE
18
+ else
19
+ Rational(amount_mutations_killed, amount_mutation_results)
20
+ end
32
21
  end
33
-
34
22
  end # Coverage
35
23
 
36
24
  # Class level mixin
@@ -47,7 +35,6 @@ module Mutant
47
35
  # @return [undefined]
48
36
  #
49
37
  # @api private
50
- #
51
38
  def sum(name, collection)
52
39
  define_method(name) do
53
40
  public_send(collection).map(&name).reduce(0, :+)
@@ -56,12 +43,17 @@ module Mutant
56
43
  end
57
44
  end # ClassMethods
58
45
 
59
- # Return overhead
46
+ private_constant(*constants(false))
47
+
48
+ # Mutant overhead running mutatet tests
49
+ #
50
+ # This is NOT the overhead of mutation testing, just an engine specific
51
+ # measurement for the efficiency of the parellelization engine, kill
52
+ # isolation etc.
60
53
  #
61
54
  # @return [Float]
62
55
  #
63
56
  # @api private
64
- #
65
57
  def overhead
66
58
  runtime - killtime
67
59
  end
@@ -73,7 +65,6 @@ module Mutant
73
65
  # @return [undefined]
74
66
  #
75
67
  # @api private
76
- #
77
68
  def self.included(host)
78
69
  host.class_eval do
79
70
  include Adamantium, Anima::Update
@@ -90,18 +81,16 @@ module Mutant
90
81
  # @return [Boolean]
91
82
  #
92
83
  # @api private
93
- #
94
84
  def success?
95
85
  coverage.eql?(env.config.expected_coverage)
96
86
  end
97
87
  memoize :success?
98
88
 
99
- # Return failed subject results
89
+ # Failed subject results
100
90
  #
101
91
  # @return [Array<Result::Subject>]
102
92
  #
103
93
  # @api private
104
- #
105
94
  def failed_subject_results
106
95
  subject_results.reject(&:success?)
107
96
  end
@@ -111,22 +100,20 @@ module Mutant
111
100
  sum :amount_mutations_killed, :subject_results
112
101
  sum :killtime, :subject_results
113
102
 
114
- # Return amount of mutations
103
+ # Amount of mutations
115
104
  #
116
105
  # @return [Fixnum]
117
106
  #
118
107
  # @api private
119
- #
120
108
  def amount_mutations
121
109
  env.mutations.length
122
110
  end
123
111
 
124
- # Return amount of subjects
112
+ # Amount of subjects
125
113
  #
126
114
  # @return [Fixnum]
127
115
  #
128
116
  # @api private
129
- #
130
117
  def amount_subjects
131
118
  env.subjects.length
132
119
  end
@@ -155,7 +142,6 @@ module Mutant
155
142
  # @return [Boolean]
156
143
  #
157
144
  # @api private
158
- #
159
145
  def success?
160
146
  alive_mutation_results.empty?
161
147
  end
@@ -165,68 +151,61 @@ module Mutant
165
151
  # @return [Boolean]
166
152
  #
167
153
  # @api private
168
- #
169
154
  def continue?
170
155
  mutation_results.all?(&:success?)
171
156
  end
172
157
 
173
- # Return killed mutations
158
+ # Killed mutations
174
159
  #
175
160
  # @return [Array<Result::Mutation>]
176
161
  #
177
162
  # @api private
178
- #
179
163
  def alive_mutation_results
180
164
  mutation_results.reject(&:success?)
181
165
  end
182
166
  memoize :alive_mutation_results
183
167
 
184
- # Return amount of mutations
168
+ # Amount of mutations
185
169
  #
186
170
  # @return [Fixnum]
187
171
  #
188
172
  # @api private
189
- #
190
173
  def amount_mutation_results
191
174
  mutation_results.length
192
175
  end
193
176
 
194
- # Return amount of mutations
177
+ # Amount of mutations
195
178
  #
196
179
  # @return [Fixnum]
197
180
  #
198
181
  # @api private
199
- #
200
182
  def amount_mutations
201
183
  subject.mutations.length
202
184
  end
203
185
 
204
- # Return number of killed mutations
186
+ # Number of killed mutations
205
187
  #
206
188
  # @return [Fixnum]
207
189
  #
208
190
  # @api private
209
- #
210
191
  def amount_mutations_killed
211
192
  killed_mutation_results.length
212
193
  end
213
194
 
214
- # Return number of alive mutations
195
+ # Number of alive mutations
215
196
  #
216
197
  # @return [Fixnum]
217
198
  #
218
199
  # @api private
219
- #
220
200
  def amount_mutations_alive
221
201
  alive_mutation_results.length
222
202
  end
223
203
 
224
- # Return alive mutations
204
+ # Alive mutations
225
205
  #
226
206
  # @return [Array<Result::Mutation>]
227
207
  #
228
208
  # @api private
229
- #
230
209
  def killed_mutation_results
231
210
  mutation_results.select(&:success?)
232
211
  end
@@ -238,12 +217,11 @@ module Mutant
238
217
  class Mutation
239
218
  include Result, Anima.new(:mutation, :test_result)
240
219
 
241
- # Return runtime
220
+ # The runtime
242
221
  #
243
222
  # @return [Float]
244
223
  #
245
224
  # @api private
246
- #
247
225
  def runtime
248
226
  test_result.runtime
249
227
  end
@@ -255,7 +233,6 @@ module Mutant
255
233
  # @return [Boolean]
256
234
  #
257
235
  # @api private
258
- #
259
236
  def success?
260
237
  mutation.class.success?(test_result)
261
238
  end