Module: Crystalball::Predictor::Helpers::AffectedExampleGroupsDetector

Included in:
ModifiedExecutionPaths, ModifiedSupportSpecs, Rails::Predictor::ModifiedSchema
Defined in:
lib/crystalball/predictor/helpers/affected_example_groups_detector.rb

Overview

Helper module to fetch example groups affected by given list of changed files

Instance Method Summary collapse

Instance Method Details

#detect_examples(files, map) ⇒ Array<String>

Fetch examples affected by given list of files

Parameters:

Returns:

  • (Array<String>)

    list of affected examples



12
13
14
15
16
# File 'lib/crystalball/predictor/helpers/affected_example_groups_detector.rb', line 12

def detect_examples(files, map)
  map.example_groups.map do |uid, example_group_map|
    uid if files.any? { |file| example_group_map.include?(file) }
  end.compact
end