Class: MinitestBender::Recorders::ProgressGroupsAndIssues

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

Instance Method Summary collapse

Constructor Details

#initialize(io, total_tests_count) ⇒ ProgressGroupsAndIssues

Returns a new instance of ProgressGroupsAndIssues.



4
5
6
7
# File 'lib/minitest-bender/recorders/progress_groups_and_issues.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_and_issues.rb', line 9

def print_context(_result_context)
  # do nothing
end


20
21
22
23
24
25
26
27
28
29
30
# File 'lib/minitest-bender/recorders/progress_groups_and_issues.rb', line 20

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
16
17
18
# File 'lib/minitest-bender/recorders/progress_groups_and_issues.rb', line 13

def print_result(result)
  printer.print_line(result_line(result)) unless result.passed?
  lines = result.state.detail_lines_without_header(result)
  printer.print_lines(lines)
  printer.advance
end