var vows = require('vows');
var assert = require('assert');
var fs = require('fs');
var path = require('path');
var compiler = require('./../index');

vows.describe('HTMLCompiler').addBatch({
  'An HTMLCompiler': {
    'when compiling a template with no includes in debug mode': {
      topic: function () {
        compiler.compile('./test/support/web/htm/src/a.html', 'debug', {
          server: {
            root: './test/support/web'
          },
          html: {
            output: './htm/build'
          },
          js: {
            output: './js/build'
          }
        }, this.callback);
      },
      'should produce the same template': function (error, result) {
        assert(!error);
        assert.equal(result, path.resolve('./test/support/web/htm/build/a.html'));
        assert(fs.existsSync(path.resolve('./test/support/web/htm/build/a.html')));
      }
    },
    'when compiling a template with includes in debug mode': {
      topic: function () {
        compiler.compile('./test/support/web/htm/src/b.html', 'debug', {
          server: {
            root: './test/support/web'
          },
          html: {
            output: './build'
          },
          js: {
            output: './js/build'
          }
        }, this.callback);
      },
      'should produce a template with the includes': function (error, result) {
        assert(!error);
        assert.equal(result, path.resolve('./test/support/web/html/build/b.html'));
        assert(fs.existsSync(path.resolve('./test/support/web/html/build/b.html')));
        assert(!fs.existsSync(path.resolve('./test/support/web/html/build/c.html')));
      }
    },
    'when compiling a template with includes and scripts in debug mode': {
      topic: function () {
        compiler.compile('./test/support/web/htm/src/d.html', 'debug', {
          server: {
            root: './test/support/web'
          },
          html: {
            output: './build'
          },
          js: {
            output: './js/build'
          }
        }, this.callback);
      },
      'should produce a template with the includes and scripts': function (error, result) {
        assert(!error);
        assert.equal(result, path.resolve('./test/support/web/html/build/d.html'));
        assert(fs.existsSync(path.resolve('./test/support/web/html/build/d.html')));
      }
    }
  }
}).export(module);
@@ -345,24 +345,25 @@
 port/web/htm
+l
 /src/a.html'
@@ -367,32 +367,32 @@
 ml', 'debug', %7B%0A
-
           server
@@ -487,24 +487,25 @@
 tput: './htm
+l
 /build'%0A    
@@ -760,32 +760,33 @@
 /support/web/htm
+l
 /build/a.html'))
@@ -852,16 +852,17 @@
 /web/htm
+l
 /build/a
@@ -1021,24 +1021,25 @@
 port/web/htm
+l
 /src/b.html'
@@ -1156,32 +1156,37 @@
      output: './
+html/
 build'%0A         
@@ -1810,16 +1810,17 @@
 /web/htm
+l
 /src/d.h
@@ -1918,32 +1918,32 @@
         html: %7B%0A
-
             outp
@@ -1949,16 +1949,21 @@
 put: './
+html/
 build'%0A 

Refactor the file paths for the html compiler test