Installing and using Stubbie

I thought it would also be useful if I post the installation and usage instructions here.

Installation

The simplest way to install stubbie is to just place it in your webroot, alternatively you can just create a mapping called /stubbie and point it to your install folder.

Usage

Using stubbie requires 2 steps the first is editing config.xml and the second is calling the component.

Step 1 Open up the config.xml file and edit it the following settings

<stubbie>

   <config>
      <appName value="myAppName" /><!-- the name of your app, e.g. the folder name under which the app resides, used to suffix the root path of your app -->
      <appPath value="/Full/Path/To/Root/Of/Your/App" /><!-- full path to the app, minus the app folder name -->
      <packageRoot value="com.myDomain" /><!-- if you have a mapping for your app's cfcs, e.g. com.mydomain, specify it here -->
      <saveTestFilesTo value="" /><!-- Not implemented yet, optional storage location for the test stubs -->
      <unitTestFramework value="cfcUnit"/><!-- cfcUnit and cfUnit are allowed options here -->
   </config>
   
</stubbie>

Step 2

Place the following code anywhere you wish to invoke stubbie from:

<cfset configFilePath = ExpandPath("./config.xml")/>

<cfset stubbie = CreateObject("component","Stubbie").init(configFilePath)/>
<cfset stubbie.build()/>

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress