Class: Evilution::Integration::RSpec::ResultBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/integration/rspec/result_builder.rb

Instance Method Summary collapse

Instance Method Details

#from_run(status, command, detector) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/evilution/integration/rspec/result_builder.rb', line 24

def from_run(status, command, detector)
  return { passed: true, test_command: command } if status.zero?

  if detector.only_crashes?
    classes = detector.unique_crash_classes
    return {
      passed: false,
      test_crashed: true,
      error: "test crashes: #{detector.crash_summary}",
      error_class: (classes.first if classes.length == 1),
      test_command: command
    }
  end

  { passed: false, test_command: command }
end

#unresolved(mutation) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/evilution/integration/rspec/result_builder.rb', line 6

def unresolved(mutation)
  {
    passed: false,
    unresolved: true,
    error: "no matching spec resolved for #{mutation.file_path}",
    test_command: "rspec (skipped: no spec resolved for #{mutation.file_path})"
  }
end

#unresolved_example(mutation) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/evilution/integration/rspec/result_builder.rb', line 15

def unresolved_example(mutation)
  {
    passed: false,
    unresolved: true,
    error: "no matching example found for #{mutation.file_path}",
    test_command: "rspec (skipped: no matching example for #{mutation.file_path})"
  }
end