Class: Cucover::Recording

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

Defined Under Namespace

Classes: CoveredFile

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#additional_covered_files=(value) ⇒ Object

Sets the attribute additional_covered_files



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



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

def analyzer
  @analyzer
end

#end_timeObject

Returns the value of attribute 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



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



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



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

def start_time
  @start_time
end

Instance Method Details

#covered_filesObject



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

def covered_files
  @covered_files ||= analyzed_covered_files + additional_covered_files
end

#covers_file?(source_file) ⇒ Boolean



13
14
15
# File 'lib/cucover/recording.rb', line 13

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

#covers_line?(source_file, line_number) ⇒ Boolean



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

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

#failed?Boolean



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

def failed?
  !!exception
end

#feature_filenameObject



9
10
11
# File 'lib/cucover/recording.rb', line 9

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