lib/cucumber/formatter/console.rb in cucumber-0.4.0 vs lib/cucumber/formatter/console.rb in cucumber-0.4.1

- old
+ new

@@ -124,29 +124,31 @@ @io.puts format_string("\nThe --wip switch was used, so the failures were expected. All is good.\n", :passed) end end def print_tag_limit_warnings(options) - first_tag = true - options[:tag_names].each do |tag_name, limit| - unless Ast::Tags.exclude_tag?(tag_name) - tag_frequnecy = @tag_occurences[tag_name].size - if limit && tag_frequnecy > limit - @io.puts if first_tag - first_tag = false - @io.puts format_string("#{tag_name} occurred #{tag_frequnecy} times, but the limit was set to #{limit}", :failed) - @tag_occurences[tag_name].each {|location| @io.puts format_string(" #{location}", :failed)} - @io.flush + if @tag_occurrences + first_tag = true + options[:tag_names].each do |tag_name, limit| + unless Ast::Tags.exclude_tag?(tag_name) + tag_frequency = @tag_occurrences[tag_name].size + if limit && tag_frequency > limit + @io.puts if first_tag + first_tag = false + @io.puts format_string("#{tag_name} occurred #{tag_frequency} times, but the limit was set to #{limit}", :failed) + @tag_occurrences[tag_name].each {|location| @io.puts format_string(" #{location}", :failed)} + @io.flush + end end end end end def record_tag_occurrences(feature_element, options) - @tag_occurences ||= Hash.new{|k,v| k[v] = []} + @tag_occurrences ||= Hash.new{|k,v| k[v] = []} options[:tag_names].each do |tag_name, limit| if !Ast::Tags.exclude_tag?(tag_name) && feature_element.tag_count(tag_name) > 0 - @tag_occurences[tag_name] << feature_element.file_colon_line + @tag_occurrences[tag_name] << feature_element.file_colon_line end end end def announce(announcement)