Method: BenchmarkSpec#run_all_tasks

Defined in:
lib/benchmark_spec.rb

#run_all_tasksObject



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/benchmark_spec.rb', line 110

def run_all_tasks
  return if tasks.empty?

  tasks.each do |t|
    begin
      pending t[:description] if t[:execution].nil?

      formatter.print "running #{t[:description]} ..."

      before_each_hooks.each {|b| b.call}
      report = Benchmark.measure(t[:description], &t[:execution])
      after_each_hooks.each {|a| a.call}

      reports << report
    rescue => e
      formatter.print "Error: #{e.message}".colorize(:red)
    end
  end
end