Class: Crystalball::MapGenerator::CoverageStrategy::ExecutionDetector

Inherits:
Object
  • Object
show all
Includes:
Helpers::PathFilter
Defined in:
lib/crystalball/map_generator/coverage_strategy/execution_detector.rb

Overview

Class for detecting code execution path based on coverage information diff

Instance Attribute Summary

Attributes included from Helpers::PathFilter

#root_path

Instance Method Summary collapse

Methods included from Helpers::PathFilter

#filter, #initialize

Instance Method Details

#detect(before, after) ⇒ Array<String>

Detects files affected during example execution. Transforms absolute paths to relative. Exclude paths outside of repository

@param list of files affected before example execution @param list of files affected after example execution

Returns:

  • (Array<String>)


17
18
19
# File 'lib/crystalball/map_generator/coverage_strategy/execution_detector.rb', line 17

def detect(before, after)
  filter after.reject { |file_name, after_coverage| before[file_name] == after_coverage }.keys
end