Class: Cuporter::TagReport

Inherits:
Object
  • Object
show all
Defined in:
lib/cuporter/tag_report.rb

Instance Method Summary collapse

Constructor Details

#initialize(input_file_pattern) ⇒ TagReport

Returns a new instance of TagReport.



5
6
7
# File 'lib/cuporter/tag_report.rb', line 5

def initialize(input_file_pattern)
  @input_file_pattern = input_file_pattern || "features/**/*.feature"
end

Instance Method Details

#filesObject



9
10
11
# File 'lib/cuporter/tag_report.rb', line 9

def files
  Dir[@input_file_pattern].collect {|f| File.expand_path f}
end

#scenarios_per_tagObject



13
14
15
16
17
18
19
20
21
# File 'lib/cuporter/tag_report.rb', line 13

def scenarios_per_tag
  tags = TagListNode.new("report",[])
  files.each do |file|
    feature = FeatureParser.parse(file)
    tags.merge(feature) if feature
  end
  tags.sort_all_descendants!
  tags
end