Permalink
Browse files

refactored some common functionality into a base class for tests

  • Loading branch information...
1 parent 790838f commit 672814ff0cfb5c30b780b71261c736a656535ca5 @atuttle committed Feb 11, 2011
View
16 tests/tests/TestCore.cfc
@@ -1,4 +1,4 @@
-<cfcomponent extends="mxunit.framework.TestCase">
+<cfcomponent extends="baseTest">
<cfscript>
@@ -116,18 +116,4 @@
</cfscript>
- <cffunction name="apiCall" access="private" output="false">
- <cfargument name="method" type="string"/>
- <cfargument name="uri" type="string"/>
- <cfargument name="query" type="string"/>
- <cfhttp method="#arguments.method#" url="http://localhost/taffy/tests/index.cfm#arguments.uri#?#arguments.query#" result="local.result"/>
- <cfreturn local.result />
- </cffunction>
-
- <cffunction name="getUrl" access="private" output="false">
- <cfargument name="url" type="string" required="true" />
- <cfhttp method="get" url="#arguments.url#" result="local.result" />
- <cfreturn local.result />
- </cffunction>
-
</cfcomponent>
View
2 tests/tests/TestFactory.cfc
@@ -1,4 +1,4 @@
-<cfcomponent extends="mxunit.framework.TestCase">
+<cfcomponent extends="baseTest">
<cfscript>
function beforeTests(){
View
2 tests/tests/TestRepresentations.cfc
@@ -1,4 +1,4 @@
-component extends="mxunit.framework.TestCase" {
+component extends="baseTest" {
function beforeTests(){
variables.representation = createObject("taffy.core.baseRepresentation");
View
2 tests/tests/TestResource.cfc
@@ -1,4 +1,4 @@
-component extends="mxunit.framework.TestCase" {
+component extends="baseTest" {
function beforeTests(){
variables.taffy = createObject("component","taffy.tests.Application");
View
17 tests/tests/baseTest.cfc
@@ -0,0 +1,17 @@
+<cfcomponent extends="mxunit.framework.TestCase">
+
+ <cffunction name="apiCall" access="private" output="false">
+ <cfargument name="method" type="string"/>
+ <cfargument name="uri" type="string"/>
+ <cfargument name="query" type="string"/>
+ <cfhttp method="#arguments.method#" url="http://localhost/taffy/tests/index.cfm#arguments.uri#?#arguments.query#" result="local.result"/>
+ <cfreturn local.result />
+ </cffunction>
+
+ <cffunction name="getUrl" access="private" output="false">
+ <cfargument name="url" type="string" required="true" />
+ <cfhttp method="get" url="#arguments.url#" result="local.result" />
+ <cfreturn local.result />
+ </cffunction>
+
+</cfcomponent>

0 comments on commit 672814f

Please sign in to comment.