class RSpec::Core::Formatters::DocumentationFormatter

@private

def current_indentation

def current_indentation
  '  ' * @group_level
end

def example_failed(failure)

def example_failed(failure)
  output.puts failure_output(failure.example, failure.example.execution_result.exception)
end

def example_group_chain

def example_group_chain
  example_group.parent_groups.reverse
end

def example_group_finished(_notification)

def example_group_finished(_notification)
  @group_level -= 1
end

def example_group_started(notification)

def example_group_started(notification)
  output.puts if @group_level == 0
  output.puts "#{current_indentation}#{notification.group.description.strip}"
  @group_level += 1
end

def example_passed(passed)

def example_passed(passed)
  output.puts passed_output(passed.example)
end

def example_pending(pending)

def example_pending(pending)
  output.puts pending_output(pending.example, pending.example.execution_result.pending_message)
end

def failure_output(example, _exception)

def failure_output(example, _exception)
  ConsoleCodes.wrap("#{current_indentation}#{example.description.strip} (FAILED - #{next_failure_index})", :failure)
end

def initialize(output)

def initialize(output)
  super
  @group_level = 0
end

def next_failure_index

def next_failure_index
  @next_failure_index ||= 0
  @next_failure_index += 1
end

def passed_output(example)

def passed_output(example)
  ConsoleCodes.wrap("#{current_indentation}#{example.description.strip}", :success)
end

def pending_output(example, message)

def pending_output(example, message)
  ConsoleCodes.wrap("#{current_indentation}#{example.description.strip} (PENDING: #{message})", :pending)
end