def print_summary(features)
sorted_defs = @step_definitions.keys.sort_by{|step_definition| step_definition.backtrace_line}
sorted_defs.each do |step_definition|
step_matches_and_descriptions = @step_definitions[step_definition].sort_by do |step_match_and_description|
step_match = step_match_and_description[0]
step_match.step_definition.regexp_source
end
step_matches = step_matches_and_descriptions.map{|step_match_and_description| step_match_and_description[0]}
lengths = step_matches_and_descriptions.map do |step_match_and_description|
step_match_and_description[2]
end
lengths << step_definition.text_length
max_length = lengths.max
@io.print step_definition.regexp_source
@io.puts format_string(" # #{step_definition.file_colon_line}".indent(max_length - step_definition.text_length), :comment)
da = step_matches_and_descriptions.map do |step_match_and_description|
step_match = step_match_and_description[0]
description = step_match_and_description[1]
length = step_match_and_description[2]
file_colon_line = step_match_and_description[3]
" #{description}" + format_string(" # #{file_colon_line}".indent(max_length - length), :comment)
end
da.sort.each{|d| puts d}
end
print_unused_step_definitions
end