 
   it 'should compile ejs', (done) ->
     run "cd \"#{test_path}\"; ../../bin/roots compile --no-compress", ->
-      fs.existsSync(path.join(test_path, 'public/index.html')).should.be.ok
-      shell.rm '-rf', path.join(test_path, 'public')
-      done()
+      files_exist test_path, ['public/index.html']
+      done()
+
+  after ->
+    remove path.join(test_path, 'public')
 
 describe 'coffeescript', ->
   test_path = path.join root, './coffeescript'

        done()

    it 'should load custom templates correctly', (done) ->

      test_repo = 'https://github.com/jenius/cli-js.git'
      test_name = 'test'
      test_path = path.join(root, 'testproj')
      tmpl_path = path.join(root, '../templates/new', test_name)

      run "./bin/roots template add test #{test_repo}", ->
        run "cd #{root}; ../bin/roots new testproj --#{test_name}", (err) ->
          fs.existsSync(test_path).should.be.ok
          fs.existsSync(path.join(test_path, 'package.json')).should.be.ok
          shell.rm('-rf', test_path)
          shell.rm('-rf', tmpl_path)
          config.remove('templates', 'test')
          done()

describe 'compiler', ->
  compiler = null

      done()

  it 'copies static files', ->
    files_exist test_path, ['public/whatever.poop']
    require_content = fs.readFileSync path.join(test_path, 'public/whatever.poop'), 'utf8'
    require_content.should.match /roots dont care/

  after ->
    remove path.join(test_path, 'public')

describe 'errors', ->
  test_path = path.join root, './errors'
