Module: Cucumber::Formatter::Duration

Included in:
Console, Runtime
Defined in:
lib/cucumber/formatter/duration.rb

Instance Method Summary collapse

Instance Method Details

#format_duration(seconds) ⇒ Object

Helper method for formatters that need to format a duration in seconds to the UNIX time format.



9
10
11
12
# File 'lib/cucumber/formatter/duration.rb', line 9

def format_duration(seconds)
  m, s = seconds.divmod(60)
  "#{m}m#{format('%<seconds>.3f', seconds: s)}s"
end