Sha256: 368586a7900938d320fb64c30a9917e6cc8975f8fdf1eb9be900ade0414a51ad

Contents?: true

Size: 702 Bytes

Versions: 184

Compression:

Stored size: 702 Bytes

Contents

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

Version data entries

184 entries across 160 versions & 4 rubygems

Version Path
rhodes-3.0.0.beta.7 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-3.0.0.beta.6 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-3.0.0.beta.5 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-3.0.0.beta.4 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-3.0.0.beta.3 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-3.0.0.beta.2 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-3.0.0.beta.1 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.4.1 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.4.1.beta.1 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.4.0 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.4.0.beta.2 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.4.0.beta.1 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.3.2 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.3.2.beta.2 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.3.2.beta.1 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.3.1 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.3.1.beta.1 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.3.0 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.3.0.beta.3 lib/extensions/mspec/mspec/runner/formatters/describe.rb
rhodes-2.3.0.beta.2 lib/extensions/mspec/mspec/runner/formatters/describe.rb