rails/rails — pull request #4719 by markmcspadden (2012-01-27 09:02:49+00:00)
Title: Add Inflection test (and fixes) to ensure singularizing a singular actually give you the correct singular in more cases

I have a singularize issue, but in running through the some previous singularize issues tonight (#2608 #1825 #2395) I do understand that the current Core position is not to touch the inflections. I get it...but there is a major point release on the horizon, so now is as good a time as any....

I started out just wanting to address the case of singularizing words that end in 'ss'. In the current state "dress".singularize becomes "dres" and "boss" becomes "bos", etc. I think this is beyond just an edge case and should be handled by the framework.

When I got into the code, I realized there was a section for testing that pluralized words returned the expected pluralized versions, but not the same for singular. I added the test for "test_singularize_singular_#{singular}" and to my surprise adding this set of tests caused 13 failures. This may or may not be a surprise to you guys...and there may be a good reason why this set of tests isn't in there.

But in the case that there is not, I made corrections to make that set of tests pass and in the process my double s problem was fixed. (The words 'process' and 'address' were already in the test case and failed when the new set of tests was added.)

I'm open to suggestions on the changes themselves, but do believe that it's a reasonable expectation that the cases tested for work in this case. Thanks!