Class: Cucover::Recording

Inherits:
Struct
  • Object
show all
Defined in:
lib/cucover/recording.rb

Defined Under Namespace

Classes: CoveredFile

Constant Summary collapse

IGNORE_PATTERNS =
[
  /gem/,
  /vendor/,
  /lib\/ruby/,
  /cucover\/lib/
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#additional_covered_files=(value) ⇒ Object

Sets the attribute additional_covered_files

Parameters:

  • value (Object)

    the value to set the attribute additional_covered_files to.

Returns:

  • (Object)

    the newly set value



2
3
4
# File 'lib/cucover/recording.rb', line 2

def additional_covered_files=(value)
  @additional_covered_files = value
end

#analyzerObject

Returns the value of attribute analyzer

Returns:

  • (Object)

    the current value of analyzer



2
3
4
# File 'lib/cucover/recording.rb', line 2

def analyzer
  @analyzer
end

#end_timeObject

Returns the value of attribute end_time

Returns:

  • (Object)

    the current value of end_time



2
3
4
# File 'lib/cucover/recording.rb', line 2

def end_time
  @end_time
end

#exceptionObject

Returns the value of attribute exception

Returns:

  • (Object)

    the current value of exception



2
3
4
# File 'lib/cucover/recording.rb', line 2

def exception
  @exception
end

#file_colon_lineObject

Returns the value of attribute file_colon_line

Returns:

  • (Object)

    the current value of file_colon_line



2
3
4
# File 'lib/cucover/recording.rb', line 2

def file_colon_line
  @file_colon_line
end

#start_timeObject

Returns the value of attribute start_time

Returns:

  • (Object)

    the current value of start_time



2
3
4
# File 'lib/cucover/recording.rb', line 2

def start_time
  @start_time
end

Instance Method Details

#covered_filesObject



28
29
30
# File 'lib/cucover/recording.rb', line 28

def covered_files
  @covered_files ||= analyzed_covered_files + additional_covered_files
end

#covers_file?(source_file) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/cucover/recording.rb', line 20

def covers_file?(source_file)
  covered_files.include?(source_file)
end

#covers_line?(source_file, line_number) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/cucover/recording.rb', line 24

def covers_line?(source_file, line_number)
  covered_files.detect{ |f| f.file == source_file }.covers_line?(line_number)
end

#failed?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/cucover/recording.rb', line 32

def failed?
  !!exception
end

#feature_filenameObject



16
17
18
# File 'lib/cucover/recording.rb', line 16

def feature_filename
  file_colon_line.split(':').first
end