HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.5.9/spec/mspec/lib/mspec/runner/formatters/describe.rb
require 'mspec/runner/formatters/dotted'
require 'mspec/runner/actions/tally'

class DescribeFormatter < DottedFormatter
  # Callback for the MSpec :finish event. Prints a summary of
  # the number of errors and failures for each +describe+ block.
  def finish
    describes = Hash.new { |h,k| h[k] = Tally.new }

    @exceptions.each do |exc|
      desc = describes[exc.describe]
      exc.failure? ? desc.failures! : desc.errors!
    end

    print "\n"
    describes.each do |d, t|
      text = d.size > 40 ? "#{d[0,37]}..." : d.ljust(40)
      print "\n#{text} #{t.failure}, #{t.error}"
    end
    print "\n" unless describes.empty?

    print "\n#{@timer.format}\n\n#{@tally.format}\n"
  end
end