Class: Test::Unit::TestResult

Inherits:
Object
  • Object
show all
Defined in:
lib/shoulda_benchmark.rb

Instance Method Summary collapse

Instance Method Details

#to_old_sObject



34
# File 'lib/shoulda_benchmark.rb', line 34

alias :to_old_s :to_s

#to_sObject



35
36
37
38
39
# File 'lib/shoulda_benchmark.rb', line 35

def to_s
  Shoulda.runtimes.collect{|name, total| [name, total]}.
    sort{|runtime1, runtime2| runtime2[1] <=> runtime1[1]}[0...10].
    collect{|name, total| "#{"%0.2f" % total} s: #{name.to_s.gsub(/test: /, "")}"}.<<("").<<(to_old_s).join("\n")
end