Sha256: 5b98f3b788e5e0ee6243f2ca31bd050cfb7416fa25629b20cd810dfd76b7b343
Contents?: true
Size: 821 Bytes
Versions: 22
Compression:
Stored size: 821 Bytes
Contents
module Cucumber module Formatter # The formatter used for <tt>--format tag_cloud</tt> # Custom formatter that prints a tag cloud as a table. class TagCloud < Cucumber::Ast::Visitor def initialize(step_mother, io, options) super(step_mother) @io = io @options = options @counts = Hash.new{|h,k| h[k] = 0} end def visit_features(features) super print_summary(features) end def visit_tag_name(tag_name) @counts[tag_name] += 1 end def print_summary(features) matrix = @counts.to_a.sort{|paira, pairb| paira[0] <=> pairb[0]}.transpose table = Cucumber::Ast::Table.new(matrix) Cucumber::Formatter::Pretty.new(@step_mother, @io, {}).visit_multiline_arg(table) end end end end
Version data entries
22 entries across 22 versions & 5 rubygems