PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/wheels/tests/_plugins/loading.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 32 lines | 26 code | 6 blank | 0 comment | 0 complexity | 8a052b472d5e7d3238efbf752aa8ef5e MD5 | raw file
 1<cfcomponent>
 2
 3	<cfinclude template="testhelper.cfm">
 4	
 5	<cffunction name="_setup">
 6		<cfset global.plugins.$installPlugin("TestScaffold")>
 7		<cfset global.plugins.$installPlugin("TestScaffoldIncompatable")>
 8	</cffunction>
 9	
10	<cffunction name="_teardown">
11		<cfset global.plugins.$uninstallPlugin("TestScaffold")>
12		<cfset global.plugins.$uninstallPlugin("TestScaffoldIncompatable")>
13	</cffunction>
14
15	<cffunction name="test_loading_and_unloading_plugin">
16		<cfset global.plugins.$unloadAllPlugins()>
17		<cfset global.plugins.$loadPlugin("TestScaffold")>
18		<cfset assert("global.plugins.$isloadedPlugin('TestScaffold') eq true")>
19 		<cfset global.plugins.$unloadPlugin("TestScaffold")>
20		<cfset assert("global.plugins.$isloadedPlugin('TestScaffold') eq false")>
21	</cffunction>
22
23	<cffunction name="test_cannot_load_incompatable_plugins">
24		<cfset loc = {}>
25		<cfset global.plugins.$loadPlugin("TestScaffold")>
26		<cfset assert("global.plugins.$isloadedPlugin('TestScaffold') eq true")>
27		<cfset loc.e = raised("global.plugins.$loadPlugin('TestScaffoldIncompatable')")>
28		<cfset loc.r = "Wheels.IncompatiblePlugin">
29		<cfset assert("loc.e eq loc.r")>
30	</cffunction>
31
32</cfcomponent>