Class: MinitestBender::Recorders::ProgressGroups

Inherits:
Object
  • Object
show all
Defined in:
lib/minitest-bender/recorders/progress_groups.rb

Instance Method Summary collapse

Constructor Details

#initialize(io, total_tests_count) ⇒ ProgressGroups

Returns a new instance of ProgressGroups.



4
5
6
7
# 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

Instance Method Details



9
10
11
# File 'lib/minitest-bender/recorders/progress_groups.rb', line 9

def print_context(_result_context)
  # do nothing
end


17
18
19
20
21
22
23
24
25
26
27
# 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


13
14
15
# File 'lib/minitest-bender/recorders/progress_groups.rb', line 13

def print_result(result)
  printer.advance
end