class MinitestBender::Recorders::ProgressGroups
Attributes
printer[R]
total_tests_count[R]
Public Class Methods
new(io, total_tests_count)
click to toggle source
# File lib/minitest-bender/recorders/progress_groups.rb, line 4 def initialize(io, total_tests_count) @printer = Printers::WithProgressBar.new(io, total_tests_count) @total_tests_count = total_tests_count end
Public Instance Methods
print_context(_result_context)
click to toggle source
# File lib/minitest-bender/recorders/progress_groups.rb, line 9 def print_context(_result_context) # do nothing end
print_context_with_results(result_context, results)
click to toggle source
# File lib/minitest-bender/recorders/progress_groups.rb, line 17 def print_context_with_results(result_context, results) context_path = result_context.path context_separator = result_context.separator prefix = result_context.prefix path = context_path[0...-1].join(context_separator) path << context_separator unless path.empty? klass = context_path.last printer.print_line("#{prefix}#{counters(result_context)} #{path}#{Colorizer.colorize(klass, :normal, :bold)}") end
print_result(result)
click to toggle source
# File lib/minitest-bender/recorders/progress_groups.rb, line 13 def print_result(result) printer.advance end
Private Instance Methods
counters(result_context)
click to toggle source
# File lib/minitest-bender/recorders/progress_groups.rb, line 33 def counters(result_context) states.map do |state| state.colored_icon_with_context_count(result_context, counters_padding_right) end.join(' ') end
counters_padding_right()
click to toggle source
# File lib/minitest-bender/recorders/progress_groups.rb, line 43 def counters_padding_right @counters_padding_right ||= total_tests_count.to_s.size + 1 end
states()
click to toggle source
# File lib/minitest-bender/recorders/progress_groups.rb, line 39 def states @states ||= MinitestBender.states.values end