PageRenderTime 57ms CodeModel.GetById 54ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/wheels/tests/view/text/wordTruncate.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 30 lines | 25 code | 5 blank | 0 comment | 0 complexity | 91f0c6d3ab6c95ba16ce46d3db73e211 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.controller = controller(name="dummy")>
 5		<cfset loc.args = {}>
 6		<cfset loc.args.text = "Wheels is a framework for ColdFusion">
 7	</cffunction>
 8
 9	<cffunction name="test_default_values">
10		<cfset loc.e = loc.controller.wordTruncate(argumentcollection=loc.args)>
11		<cfset loc.r = "Wheels is a framework for...">
12		<cfset assert("loc.e eq loc.r")>
13	</cffunction>
14
15	<cffunction name="test_text_is_blank">
16		<cfset loc.args.text = "">
17		<cfset loc.e = loc.controller.wordTruncate(argumentcollection=loc.args)>
18		<cfset loc.r = "">
19		<cfset assert("loc.e eq loc.r")>
20	</cffunction>
21
22	<cffunction name="test_specify_options">
23		<cfset loc.args.length = 4>
24		<cfset loc.args.truncateString = " [more]">
25		<cfset loc.e = loc.controller.wordTruncate(argumentcollection=loc.args)>
26		<cfset loc.r = "Wheels is a framework [more]">
27		<cfset assert("loc.e eq loc.r")>
28	</cffunction>
29
30</cfcomponent>