PageRenderTime 42ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 20ms app.codeStats 0ms

/wheels/tests/_plugins/repos.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 52 lines | 44 code | 8 blank | 0 comment | 0 complexity | e7b301442d1a0bb258b81fad73e7ed49 MD5 | raw file
 1<cfcomponent>
 2
 3	<cfinclude template="testhelper.cfm">
 4
 5	<cffunction name="test_repo_exists">
 6		<cfset assert("global.plugins.$existsRepo(global.repo)")>
 7	</cffunction>
 8
 9	<cffunction name="test_repo_set">
10		<cfset assert("global.plugins.$getRepo() eq global.repo")>
11	</cffunction>
12
13	<cffunction name="test_repo_lists_correct_number_of_available_plugins_and_version">
14		<cfset loc = {}>
15		<cfset loc.plugins = global.plugins.$inspectPlugins()>
16		<cfset debug("loc.plugins", false)>
17		<cfset assert("StructKeyExists(loc.plugins, 'TestScaffold')")>
18		<cfset assert("arraylen(loc.plugins['TestScaffold']) eq 2")>
19		<cfset assert("StructKeyExists(loc.plugins, 'TestModelValidators')")>
20		<cfset assert("arraylen(loc.plugins['TestModelValidators']) eq 1")>
21		<cfset assert("StructKeyExists(loc.plugins, 'TestFlashHelpers')")>
22		<cfset assert("arraylen(loc.plugins['TestFlashHelpers']) eq 1")>
23	</cffunction>
24
25	<cffunction name="test_get_latest_version_of_a_plugin">
26		<cfset loc = {}>
27		<cfset loc.plugin = global.plugins.$selectPlugin("TestScaffold")>
28		<cfset debug("loc.plugin", false)>
29		<cfset loc.r = loc.plugin.version>
30		<cfset loc.e = "0.3.5">
31		<cfset assert("loc.e eq loc.r")>
32	</cffunction>
33
34	<cffunction name="test_get_particular_version_of_a_plugin">
35		<cfset loc = {}>
36		<cfset loc.plugin = global.plugins.$selectPlugin(name="TestScaffold", version="0.3.1")>
37		<cfset debug("loc.plugin", false)>
38		<cfset loc.r = loc.plugin.version>
39		<cfset loc.e = "0.3.1">
40		<cfset assert("loc.e eq loc.r")>
41	</cffunction>
42
43	<cffunction name="test_get_nonexistent_version_of_a_plugin_should_get_latest_version">
44		<cfset loc = {}>
45		<cfset loc.plugin = global.plugins.$selectPlugin(name="TestScaffold", version="0.1.9")>
46		<cfset debug("loc.plugin", false)>
47		<cfset loc.r = loc.plugin.version>
48		<cfset loc.e = "0.3.5">
49		<cfset assert("loc.e eq loc.r")>
50	</cffunction>
51
52</cfcomponent>