Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersongirao committed May 20, 2014
1 parent 197d0ae commit 5f6cb04
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rspec/nagios/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def summary_line(duration, example_count, failure_count, pending_count)
else
summary << " Critical"
end

summary << " - " << pluralize(example_count, "example")
summary << ", " << pluralize(failure_count, "failure")
summary << ", #{pending_count} pending" if pending_count > 0
Expand All @@ -46,9 +47,10 @@ def summary_line(duration, example_count, failure_count, pending_count)
summary << " pending=#{pending_count}"
summary << " conformance=#{conformance}%"
summary << " time=#{time}s"
if failed_examples.size > 0

if failed_examples.any?
summary << "\n"
summary << "#{failed_examples.map { |e| "#{e.metadata.send(:location)} #{e.full_description}" }.join("\n") }"
summary << "#{failed_examples.map { |e| "#{e.location} #{e.full_description}" }.join("\n") }"
end

summary
Expand Down

0 comments on commit 5f6cb04

Please sign in to comment.