mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
13 lines
302 B
Ruby
13 lines
302 B
Ruby
module AcceptanceTests
|
|
module PluralizationHelpers
|
|
def pluralize(count, singular_version, plural_version = nil)
|
|
plural_version ||= singular_version + 's'
|
|
|
|
if count == 1
|
|
"#{count} #{singular_version}"
|
|
else
|
|
"#{count} #{plural_version}"
|
|
end
|
|
end
|
|
end
|
|
end
|