       expected = parseInt(comments[0])    
       eq comments.length, expected, [
         ""
-        "#{path.basename(language_output)} comments"
+        "#{path.basename(languageOutput)} comments"
         "------------------------"
         " expected : #{expected}"
         " found    : #{comments.length}"
       ].join '\n'
       
       # Invoke the next test
-      test_next_language keys, callback
+      testNextLanguage keys, callback
       
   # Kick off the first language test.
-  test_next_language language_keys.slice(), ->
+  testNextLanguage languageKeys.slice(), ->
     # Test to be sure block comments are excluded when not explicitly
     # specified.  In this case, the test will check for the existence 
     # of only 1 comment in all languages (a single-line)
     options.blocks = false
-    test_next_language language_keys.slice()
+    testNextLanguage languageKeys.slice()
     


# Verify we can use a custom jst template file
test "custom JST template file", ->
  test_docco_run "custom_jst", 
    ["#{test_path}/*.coffee"],
    template: "#{resources_path}/pagelet.jst"

# Verify we can use a custom CSS file
test "custom CSS file", ->
  test_docco_run "custom_css", 
    ["#{test_path}/*.coffee"],
    css: "#{resources_path}/pagelet.css"

#### Docco Comment Parser

# Verify we can parse expected comments from each supported language.
test "single line comment parsing", ->
  comments_path = path.join test_path, "comments"
  options =
    template: "#{comments_path}/comments.jst"

  # Construct a list of languages to test asynchronously.  It's important
  # that these be tested one at a time, to avoid conflicts between multiple
  # file extensions for a language.  e.g. `c.c` and `c.h` both output to 
  # c.html, so they must be run at separate times.
  language_keys = (ext for ext,l of Docco.languages)

  test_next_language = (keys,callback) ->
    # We're all done here.
    return callback?() if not keys.length

    ext = keys.shift()
    l = Docco.languages[ext]

    language_example = path.join comments_path, "#{l.name}#{ext}"
    language_test    = "comments_test/#{l.name}"
    language_path    = path.join data_path, language_test

    # Skip over this language if there is no corresponding test.
    return test_next_language(keys, callback) if not path.existsSync language_example   
   
    # Run them through docco with the custom `comments.jst` file that 
    # outputs a CSV list of doc blocks text.    
    test_docco_run language_test, [language_example], options, ->
  
      # Be sure the expected output file exists
      language_output = path.join language_path, "#{l.name}.html"
      eq true, path.existsSync(language_output), "#{language_output} -> output file created properly"

      # Read in the output file contents, split them into a list
      # of comments.
      content = fs.readFileSync(language_output).toString()
      comments = (c.trim() for c in content.split(',') when c.trim() != '') 
      eq true, comments.length >= 1, 'expect at least the descriptor comment'


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 

