 # expected output.  This exercises the no options branches of
 # logic.  
 test "documenting Docco", ->
-  docs_path = path.normalize("#{test_path}/../docs")
-  sources   = ["#{test_path}/../src/docco.coffee","#{test_path}/tests.coffee"]
+  docsPath = path.normalize("#{testPath}/../docs")
+  sources   = ["#{testPath}/../src/docco.coffee","#{testPath}/tests.coffee"]
 
   # We need to remove the docs/ directory to ensure it contains
   # no files.  If it contains files when this test is run, the 
   # assertion checks could be compromised, making the test itself
   # quite britle.
-  exec "rm -rf #{docs_path}", ->
+  exec "rm -rf #{docsPath}", ->
     Docco.document sources,null, ->
-      found       = fs.readdirSync(docs_path).length
+      found       = fs.readdirSync(docsPath).length
       files       = []
       files       = files.concat(Docco.resolveSource(src)) for src in sources
       expected    = files.length + 1

# is equal to what is expected.  We assume there is one CSS file
# that is always copied to the output, so we check that the 
# number of output files is (matched_sources + 1).
test_docco_run = (test_name,sources,options=null,callback=null) ->
  dest_path = path.join data_path, test_name
  # Remove the data directory for this test run
  cleanup = (callback) -> exec "rm -rf #{dest_path}", callback
  cleanup ->
    options?.output = dest_path
    Docco.document sources, options, ->
      # Calculate the number of expected files in the output, and 
      # then the number of files actually found in the output path.
      files       = []
      files       = files.concat(Docco.resolveSource(src)) for src in sources
      expected    = files.length + 1
      found       = fs.readdirSync(dest_path).length
           
      # Check the expected number of files against the number of
      # files that were actually found.

fs            = require 'fs'

# Determine the test and resources paths
testPath      = path.dirname fs.realpathSync(__filename)
dataPath      = path.join testPath, "data"
resourcesPath = path.normalize path.join(testPath,"/../resources")

#### Docco Test Assertion Wrapper 

