Permalink
Browse files

Ensure build runs before test

  • Loading branch information...
sstephenson committed Feb 20, 2011
1 parent 3c4f3e9 commit f6db7f6aa95031d4662b0af0ffe6872694d0055c
Showing with 14 additions and 6 deletions.
  1. +14 −6 Cakefile
View
@@ -3,12 +3,20 @@ require.paths.unshift __dirname + '/lib'
{print} = require 'sys'
{spawn} = require 'child_process'
task 'build', 'Build lib/ from src/', ->
build = (callback) ->
coffee = spawn 'coffee', ['-c', '-o', 'lib', 'src']
coffee.stdout.on 'data', (data) -> print data.toString()
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
print data.toString()
coffee.on 'exit', (code) ->
callback?() if code is 0
task 'build', 'Build lib/ from src/', ->
build()
task 'test', 'Run tests', ->
invoke 'build'
process.chdir __dirname
{reporters} = require 'nodeunit'
reporters.default.run ['test']
build ->
process.chdir __dirname
{reporters} = require 'nodeunit'
reporters.default.run ['test']

0 comments on commit f6db7f6

Please sign in to comment.