Class SimpleCov::SourceFile::Line
In: lib/simplecov/source_file.rb
Parent: Object

Representation of a single line in a source file including this specific line‘s source code, line_number and code coverage, with the coverage being either nil (coverage not applicable, e.g. comment line), 0 (line not covered) or >1 (the amount of times the line was executed)

Methods

covered?   missed?   never?   new   skipped!   skipped?   status  

External Aliases

src -> source
  Lets grab some fancy aliases, shall we?
line_number -> line
line_number -> number

Attributes

coverage  [R]  The coverage data for this line: either nil (never), 0 (missed) or >=1 (times covered)
line_number  [R]  The line number in the source file. Aliased as :line, :number
skipped  [R]  Whether this line was skipped
src  [R]  The source code for this line. Aliased as :source

Public Class methods

Public Instance methods

Returns true if this is a line that has been covered

Returns true if this is a line that should have been covered, but was not

Returns true if this line is not relevant for coverage

Flags this line as skipped

Returns true if this line was skipped, false otherwise. Lines are skipped if they are wrapped with # :nocov: comment lines.

The status of this line - either covered, missed, skipped or never. Useful i.e. for direct use as a css class in report generation

[Validate]