module RSpec::Core::Formatters::Helpers

def self.pluralize(count, string)

Returns:
  • (String) - pluralized word

Parameters:
  • string (String) -- word to be pluralized
  • count (Fixnum) -- number of objects

Other tags:
    Api: - private
def self.pluralize(count, string)
  pluralized_string = if count.to_f == 1
                        string
                      elsif string.end_with?('s') # e.g. "process"
                        "#{string}es" # e.g. "processes"
                      else
                        "#{string}s"
                      end
  "#{count} #{pluralized_string}"
end