Module: Guard::Cucumber::Inspector

Defined in:
lib/guard/cucumber/inspector.rb

Overview

The inspector verifies of the changed paths are valid for Guard::Cucumber.

Class Method Summary collapse

Class Method Details

.clean(paths, sets) ⇒ Array<String>

Clean the changed paths and return only valid Cucumber features.

Parameters:

  • paths (Array<String>)

    the changed paths

  • feature_sets (Array<String>)

    the feature sets

Returns:

  • (Array<String>)

    the valid feature files



17
18
19
20
21
22
23
24
25
26
# File 'lib/guard/cucumber/inspector.rb', line 17

def clean(paths, sets)
  paths.uniq!
  paths.compact!
  paths = paths.select do |p|
    cucumber_file?(p, sets) || cucumber_folder?(p, sets)
  end
  paths = paths.delete_if { |p| included_in_other_path?(p, paths) }
  clear_cucumber_files_list
  paths
end