/wheels/tests/global/public/humanize.cfc

http://cfwheels.googlecode.com/ · ColdFusion CFScript · 33 lines · 26 code · 7 blank · 0 comment · 0 complexity · 6729395a4e871be2a9901d83cb1500b9 MD5 · raw file

  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="test_normal_variable">
  3. <cfset loc.result = humanize("wheelsIsAFramework")>
  4. <cfset assert("NOT Compare(loc.result, 'Wheels Is A Framework')")>
  5. </cffunction>
  6. <cffunction name="test_variable_starting_with_uppercase">
  7. <cfset loc.result = humanize("WheelsIsAFramework")>
  8. <cfset assert("NOT Compare(loc.result, 'Wheels Is A Framework')")>
  9. </cffunction>
  10. <cffunction name="test_abbreviation">
  11. <cfset loc.result = humanize("CFML")>
  12. <cfset assert("NOT Compare(loc.result, 'CFML')")>
  13. </cffunction>
  14. <cffunction name="test_abbreviation_as_exception">
  15. <cfset loc.result = humanize(text="ACfmlFramework", except="CFML")>
  16. <cfset assert("NOT Compare(loc.result, 'A CFML Framework')")>
  17. </cffunction>
  18. <cffunction name="test_exception_within_string">
  19. <cfset loc.result = humanize(text="ACfmlFramecfmlwork", except="CFML")>
  20. <cfset assert("NOT Compare(loc.result, 'A CFML Framecfmlwork')")>
  21. </cffunction>
  22. <cffunction name="test_abbreviation_without_exception_cannot_be_done">
  23. <cfset loc.result = humanize("wheelsIsACFMLFramework")>
  24. <cfset assert("NOT Compare(loc.result, 'Wheels Is ACFML Framework')")>
  25. </cffunction>
  26. </cfcomponent>