7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/cuke_iterations/cuke_parser.rb', line 7
def parse_features(dir)
scenarios = []
Dir.glob(File.join(dir, '**/*.feature')).each do |feature_file|
formatter = ScenarioExtractingFormatter.new
parser = Gherkin::Parser::Parser.new (formatter)
text = File.open(feature_file, 'r') { |f| f.read }
parser.parse(text, __FILE__, __LINE__-1)
scenarios << formatter.discovered_scenarios.each {|s| s[:filename] = relative_path(feature_file, dir)}
end
scenarios.flatten
end
|