This is perhaps a naive question, but what is the recommended manner of
testing a helper method in rspec? I have created a simple string
function and I want to write some tests for it. It it were a script
would just add if FILE == $0 and add the tests below that but I do
feel that this is the best way to handle a rails helper.
The code (I said it was simple) :
keycase strips leading spaces, squeezes out extra whitespace
between words, downshifts all and then capitalizes the first
character of each word.
This method prepares descriptive strings that are used
as indices for lookups. To preserve common initialisms insert
periods between letters. Thus:
IBM => Ibm but I.B.M. => I.B.M.
Do not use ! methods as they return nil under certain circumstances
value = value.to_s.strip.squeeze("
*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:firstname.lastname@example.org
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3