Class: Profiler

Inherits:
RSpec::Core::Formatters::ProgressFormatter
  • Object
show all
Defined in:
lib/profiler.rb

Instance Method Summary collapse

Instance Method Details

#dump_profileObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/profiler.rb', line 24

def dump_profile
  groups = {}
  examples.each do |e|
    e.location =~ /\/spec\//
    key = $'.gsub(/\/.*$/,'').strip.to_sym
    if groups.has_key? key
      groups[key] = groups[key] << e
    else
      groups[key] = [e]
    end
  end

  groups.each_key do |group_name|
    print_report(groups[group_name.to_sym], group_name.to_s)
  end
end