Class: Mutineer::Result
- Inherits:
-
Data
- Object
- Data
- Mutineer::Result
- Defined in:
- lib/mutineer/result.rb
Overview
Immutable outcome of running one mutant. Six distinct states:
killed — a test failed/errored, so the mutation was caught.
survived — every test passed, so the mutation went undetected.
error — the child crashed (unhandled exception): exit status 2.
timeout — the parent SIGKILLed a child that overran its wall clock.
skipped — the mutated source failed to re-parse (invalid); no fork.
no_coverage — no test exercises the mutated line; not run, not scored.
error and skipped are deliberately distinct: skipped is a pre-fork
validity failure (counted separately by the reporter), error is a runtime
crash. Never conflate them via details string parsing. no_coverage is a
pre-fork selection result (M3): excluded from the score denominator.
subject and mutation are nil when the Result is built by Isolation/Runner
(which only know the outcome); the orchestrator attaches them afterwards via
result.with(subject:, mutation:) so the Reporter can render survivor diffs.
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#mutation ⇒ Object
readonly
Returns the value of attribute mutation.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Class Method Summary collapse
- .error(details = nil) ⇒ Object
- .killed ⇒ Object
- .no_coverage ⇒ Object
- .skipped(details = nil) ⇒ Object
- .survived ⇒ Object
- .timeout ⇒ Object
Instance Method Summary collapse
- #error? ⇒ Boolean
- #killed? ⇒ Boolean
- #no_coverage? ⇒ Boolean
- #skipped? ⇒ Boolean
- #survived? ⇒ Boolean
- #timeout? ⇒ Boolean
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details
20 21 22 |
# File 'lib/mutineer/result.rb', line 20 def details @details end |
#mutation ⇒ Object (readonly)
Returns the value of attribute mutation
20 21 22 |
# File 'lib/mutineer/result.rb', line 20 def mutation @mutation end |
#status ⇒ Object (readonly)
Returns the value of attribute status
20 21 22 |
# File 'lib/mutineer/result.rb', line 20 def status @status end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject
20 21 22 |
# File 'lib/mutineer/result.rb', line 20 def subject @subject end |
Class Method Details
.error(details = nil) ⇒ Object
23 |
# File 'lib/mutineer/result.rb', line 23 def self.error(details = nil) = new(status: :error, details: details, subject: nil, mutation: nil) |
.killed ⇒ Object
21 |
# File 'lib/mutineer/result.rb', line 21 def self.killed = new(status: :killed, details: nil, subject: nil, mutation: nil) |
.no_coverage ⇒ Object
26 |
# File 'lib/mutineer/result.rb', line 26 def self.no_coverage = new(status: :no_coverage, details: nil, subject: nil, mutation: nil) |
.skipped(details = nil) ⇒ Object
25 |
# File 'lib/mutineer/result.rb', line 25 def self.skipped(details = nil) = new(status: :skipped, details: details, subject: nil, mutation: nil) |
.survived ⇒ Object
22 |
# File 'lib/mutineer/result.rb', line 22 def self.survived = new(status: :survived, details: nil, subject: nil, mutation: nil) |
.timeout ⇒ Object
24 |
# File 'lib/mutineer/result.rb', line 24 def self.timeout = new(status: :timeout, details: nil, subject: nil, mutation: nil) |
Instance Method Details
#error? ⇒ Boolean
30 |
# File 'lib/mutineer/result.rb', line 30 def error? = status == :error |
#killed? ⇒ Boolean
28 |
# File 'lib/mutineer/result.rb', line 28 def killed? = status == :killed |
#no_coverage? ⇒ Boolean
33 |
# File 'lib/mutineer/result.rb', line 33 def no_coverage? = status == :no_coverage |
#skipped? ⇒ Boolean
32 |
# File 'lib/mutineer/result.rb', line 32 def skipped? = status == :skipped |
#survived? ⇒ Boolean
29 |
# File 'lib/mutineer/result.rb', line 29 def survived? = status == :survived |
#timeout? ⇒ Boolean
31 |
# File 'lib/mutineer/result.rb', line 31 def timeout? = status == :timeout |