 
   it 'should precompile a basic template', ->
     p = path.join(@public, 'tpl/all.js')
-    should.file_exist(p)
-    should.have_content(p)
+    h.file.exists(p).should.be.ok
+    h.file.has_content(p).should.be.ok
 
   it 'should still compile other templates normally', ->
     p = path.join(@public, 'index.html')
-    should.file_exist(p)
-    should.have_content(p)
+    h.file.exists(p).should.be.ok
+    h.file.has_content(p).should.be.ok
 
   it 'should compile templates under their local path key', ->
     p = path.join(@public, 'tpl/all.js')
-    should.contain(p, 'template1')
-    should.contain(p, 'cat/dog')
+    h.file.contains(p, 'template1').should.be.ok
+    h.file.contains(p, 'cat/dog').should.be.ok
 
   it 'not compile templates that would break a normal jade compile', ->
     p = path.join(@public, 'tpl/all.js')
-    should.contain(p, 'template2')
+    h.file.contains(p, 'template2').should.be.ok
 
 describe 'extract', ->
 

path   = require 'path'
fs     = require 'fs'
should = require 'should'
glob   = require 'glob'
rimraf = require 'rimraf'
Roots  = require 'roots'
W      = require 'when'
nodefn = require 'when/node/function'
_path  = path.join(__dirname, 'fixtures')
run = require('child_process').exec

# setup, teardown, and utils

should.file_exist = (path) ->
  fs.existsSync(path).should.be.ok

should.have_content = (path) ->
  fs.readFileSync(path).length.should.be.above(1)

should.contain = (path, content) ->
  fs.readFileSync(path, 'utf8').indexOf(content).should.not.equal(-1)

compile_fixture = (fixture_name, done) ->
  @path = path.join(_path, fixture_name)
  @public = path.join(@path, 'public')
  project = new Roots(@path)
  project.compile().on('error', done).on('done', done)

before (done) ->
  tasks = []
  for d in glob.sync("#{_path}/*/package.json")
    p = path.dirname(d)
    if fs.existsSync(path.join(p, 'node_modules')) then continue
    console.log "installing deps for #{d}"
    tasks.push nodefn.call(run, "cd #{p}; npm install")
  W.all(tasks).then(-> done())

after ->
  rimraf.sync(public_dir) for public_dir in glob.sync('test/fixtures/**/public')

# tests



  it 'should compile a template to both client and static if extract is false', ->
    p1 = path.join(@public, 'tpl/all.js')
    h.file.exists(p1).should.be.ok
    h.file.has_content(p1).should.be.ok

    p2 = path.join(@public, 'tpl/template2.html')
    h.file.exists(p2).should.be.ok
    h.file.has_content(p2).should.be.ok

describe 'concat', ->

