lib/cucumber/formatter/console_counts.rb in cucumber-9.0.1 vs lib/cucumber/formatter/console_counts.rb in cucumber-9.0.2
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'cucumber/formatter/console'
module Cucumber
module Formatter
class ConsoleCounts
@@ -28,10 +30,10 @@
"#{count} step" + (count == 1 ? '' : 's')
end
def status_counts(summary)
counts = Core::Test::Result::TYPES.map { |status| [status, summary.total(status)] }
- counts = counts.select { |_status, count| count > 0 }
+ counts = counts.select { |_status, count| count.positive? }
counts = counts.map { |status, count| format_string("#{count} #{status}", status) }
"(#{counts.join(', ')})" if counts.any?
end
end
end