PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 0ms 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
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent>
  2. <cfinclude template="testhelper.cfm">
  3. <cffunction name="test_repo_exists">
  4. <cfset assert("global.plugins.$existsRepo(global.repo)")>
  5. </cffunction>
  6. <cffunction name="test_repo_set">
  7. <cfset assert("global.plugins.$getRepo() eq global.repo")>
  8. </cffunction>
  9. <cffunction name="test_repo_lists_correct_number_of_available_plugins_and_version">
  10. <cfset loc = {}>
  11. <cfset loc.plugins = global.plugins.$inspectPlugins()>
  12. <cfset debug("loc.plugins", false)>
  13. <cfset assert("StructKeyExists(loc.plugins, 'TestScaffold')")>
  14. <cfset assert("arraylen(loc.plugins['TestScaffold']) eq 2")>
  15. <cfset assert("StructKeyExists(loc.plugins, 'TestModelValidators')")>
  16. <cfset assert("arraylen(loc.plugins['TestModelValidators']) eq 1")>
  17. <cfset assert("StructKeyExists(loc.plugins, 'TestFlashHelpers')")>
  18. <cfset assert("arraylen(loc.plugins['TestFlashHelpers']) eq 1")>
  19. </cffunction>
  20. <cffunction name="test_get_latest_version_of_a_plugin">
  21. <cfset loc = {}>
  22. <cfset loc.plugin = global.plugins.$selectPlugin("TestScaffold")>
  23. <cfset debug("loc.plugin", false)>
  24. <cfset loc.r = loc.plugin.version>
  25. <cfset loc.e = "0.3.5">
  26. <cfset assert("loc.e eq loc.r")>
  27. </cffunction>
  28. <cffunction name="test_get_particular_version_of_a_plugin">
  29. <cfset loc = {}>
  30. <cfset loc.plugin = global.plugins.$selectPlugin(name="TestScaffold", version="0.3.1")>
  31. <cfset debug("loc.plugin", false)>
  32. <cfset loc.r = loc.plugin.version>
  33. <cfset loc.e = "0.3.1">
  34. <cfset assert("loc.e eq loc.r")>
  35. </cffunction>
  36. <cffunction name="test_get_nonexistent_version_of_a_plugin_should_get_latest_version">
  37. <cfset loc = {}>
  38. <cfset loc.plugin = global.plugins.$selectPlugin(name="TestScaffold", version="0.1.9")>
  39. <cfset debug("loc.plugin", false)>
  40. <cfset loc.r = loc.plugin.version>
  41. <cfset loc.e = "0.3.5">
  42. <cfset assert("loc.e eq loc.r")>
  43. </cffunction>
  44. </cfcomponent>