Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 99b0ece

Browse files
committed
Merge pull request #971 from mmb/profile_color
Use detail color instead of failure color for profile output.
2 parents 225d758 + 59097f9 commit 99b0ece

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Enhancements
2626
* Block-based DSL methods that run in the context of an example
2727
(`it`, `before(:each)`, `after(:each)`, `let` and `subject`)
2828
now yield the example as a block argument (David Chelimsky).
29+
* Times in profile output are now bold instead of failure_color.
30+
(Matthew Boedicker)
2931

3032
### 2.14.3 / 2013-07-13
3133
[full changelog](http://github.com/rspec/rspec-core/compare/v2.14.2...v2.14.3)

lib/rspec/core/formatters/base_text_formatter.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def dump_profile_slowest_examples
8989

9090
sorted_examples.each do |example|
9191
output.puts " #{example.full_description}"
92-
output.puts detail_color(" #{failure_color(format_seconds(example.execution_result[:run_time]))} #{failure_color("seconds")} #{format_caller(example.location)}")
92+
output.puts " #{bold(format_seconds(example.execution_result[:run_time]))} #{bold("seconds")} #{format_caller(example.location)}"
9393
end
9494
end
9595

@@ -117,11 +117,11 @@ def dump_profile_slowest_example_groups
117117

118118
output.puts "\nTop #{sorted_groups.size} slowest example groups:"
119119
sorted_groups.each do |loc, hash|
120-
average = "#{failure_color(format_seconds(hash[:average]))} #{failure_color("seconds")} average"
120+
average = "#{bold(format_seconds(hash[:average]))} #{bold("seconds")} average"
121121
total = "#{format_seconds(hash[:total_time])} seconds"
122122
count = pluralize(hash[:count], "example")
123123
output.puts " #{hash[:description]}"
124-
output.puts detail_color(" #{average} (#{total} / #{count}) #{loc}")
124+
output.puts " #{average} (#{total} / #{count}) #{loc}"
125125
end
126126
end
127127

0 commit comments

Comments
 (0)