Class: RSpec::Covers::ExampleResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec/covers/reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#call_logObject

Returns the value of attribute call_log

Returns:

  • (Object)

    the current value of call_log



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def call_log
  @call_log
end

#declarationObject

Returns the value of attribute declaration

Returns:

  • (Object)

    the current value of declaration



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def declaration
  @declaration
end

#declaration_validationObject

Returns the value of attribute declaration_validation

Returns:

  • (Object)

    the current value of declaration_validation



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def declaration_validation
  @declaration_validation
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def description
  @description
end

#exampleObject

Returns the value of attribute example

Returns:

  • (Object)

    the current value of example



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def example
  @example
end

#executed_locationsObject

Returns the value of attribute executed_locations

Returns:

  • (Object)

    the current value of executed_locations



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def executed_locations
  @executed_locations
end

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def file
  @file
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def id
  @id
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def line
  @line
end

#measured_locationsObject

Returns the value of attribute measured_locations

Returns:

  • (Object)

    the current value of measured_locations



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def measured_locations
  @measured_locations
end

#suggestionsObject

Returns the value of attribute suggestions

Returns:

  • (Object)

    the current value of suggestions



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def suggestions
  @suggestions
end

#unchecked_locationsObject

Returns the value of attribute unchecked_locations

Returns:

  • (Object)

    the current value of unchecked_locations



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def unchecked_locations
  @unchecked_locations
end

#verdictObject

Returns the value of attribute verdict

Returns:

  • (Object)

    the current value of verdict



13
14
15
# File 'lib/rspec/covers/reporter.rb', line 13

def verdict
  @verdict
end

Instance Method Details

#risky?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/rspec/covers/reporter.rb', line 29

def risky?
  verdict.risky?
end

#to_hObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rspec/covers/reporter.rb', line 33

def to_h
  {
    id: id,
    file: file,
    line: line,
    description: description,
    verdict: verdict.to_h,
    suggestions: suggestions.map(&:to_h),
    declaration_validation: declaration_validation&.to_h,
    measured_locations: Array(measured_locations).map(&:to_h),
    unchecked_locations: Array(unchecked_locations).map(&:to_h),
    declaration: {
      covers: declaration.covers.map(&:to_h),
      uses: declaration.uses.map(&:to_h),
      unresolved: declaration.unresolved.map(&:to_s)
    }
  }
end