# File lib/rspec/core/formatters/helpers.rb, line 9 def format_duration(duration) if duration > 60 minutes = duration.to_i / 60 seconds = duration - minutes * 60 "#{pluralize(minutes, 'minute')} #{format_seconds(seconds)} seconds" else "#{format_seconds(duration)} seconds" end end
# File lib/rspec/core/formatters/helpers.rb, line 20 def format_seconds(float) precision ||= (float < 1) ? SUB_SECOND_PRECISION : DEFAULT_PRECISION formatted = sprintf("%.#{precision}f", float) strip_trailing_zeroes(formatted) end
Generated with the Darkfish Rdoc Generator 2.