Permalink
Browse files

Fix for 1.8

  • Loading branch information...
1 parent 4d9472e commit 1c0ce8def46dc42718a7405782c23a5bd726a2c2 @justinko justinko committed Apr 18, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/rspec/core/formatters/base_text_formatter.rb
@@ -52,10 +52,13 @@ def dump_commands_to_rerun_failed_examples
end
def dump_profile
- sorted_examples = examples.sort_by { |example| example.execution_result[:run_time] }.reverse.first(10)
+ sorted_examples = examples.sort_by {|example|
+ example.execution_result[:run_time] }.reverse.first(10)
- total, slows = [examples, sorted_examples].map {|exs| exs.inject(0.0) {|i, e| i + e.execution_result[:run_time] } }
- output.puts "\nTop #{sorted_examples.size} slowest examples (#{format_seconds(slows)} seconds, #{((slows / total) * 100).round(2)}% of total time):\n"
+ total, slows = [examples, sorted_examples].map {|exs|
+ exs.inject(0.0) {|i, e| i + e.execution_result[:run_time] }}
+
+ output.puts "\nTop #{sorted_examples.size} slowest examples (#{format_seconds(slows)} seconds, #{'%.1f' % ((slows / total) * 100)}% of total time):\n"
sorted_examples.each do |example|
output.puts " #{example.full_description}"

0 comments on commit 1c0ce8d

Please sign in to comment.