Skip to content

Instantly share code, notes, and snippets.

@cpsubrian
Created November 20, 2011 21:54

Revisions

  1. Brian Link revised this gist Nov 20, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion spawn.coffee
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    ###
    The following is in a Cakefile and when I run it it causes errors.
    However, if I just run: `vows test/* --spec` on the command line, all is fine.
    However, if I just run: `vows test/*.coffee --spec` on the command line, all is fine.
    ###

    {spawn} = require 'child_process'
  2. Brian Link created this gist Nov 20, 2011.
    15 changes: 15 additions & 0 deletions spawn.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    ###
    The following is in a Cakefile and when I run it it causes errors.
    However, if I just run: `vows test/* --spec` on the command line, all is fine.
    ###

    {spawn} = require 'child_process'

    task 'test', 'Run Vows tests', ->
    args = ['test/*.coffee', '--spec']
    options = {cwd: __dirname}
    spec = spawn 'vows', args, options
    spec.stdout.on 'data', (data) -> print data.toString()
    spec.stderr.on 'data', (data) -> print data.toString()
    spec.on 'exit', (status) -> callback?() if status is 0
    16 changes: 16 additions & 0 deletions the_errors.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    $ cake test

    node.js:134
    throw e; // process.nextTick error, or 'error' event on first tick
    ^
    Error: Cannot find module '/home/cpsubrian/projects/node/coffee-dox/test/*'
    at Function._resolveFilename (module.js:317:11)
    at Function._load (module.js:262:25)
    at require (module.js:346:19)
    at /home/cpsubrian/.nvm/v0.4.11/lib/node_modules/vows/bin/vows:466:19
    at Array.reduce (native)
    at importSuites (/home/cpsubrian/.nvm/v0.4.11/lib/node_modules/vows/bin/vows:461:18)
    at Object.<anonymous> (/home/cpsubrian/.nvm/v0.4.11/lib/node_modules/vows/bin/vows:240:15)
    at Module._compile (module.js:402:26)
    at Object..js (module.js:408:10)
    at Module.load (module.js:334:31)
    3 changes: 3 additions & 0 deletions the_success.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    $ vows test/*.coffee
    ····················································································· ······
    ✓ OK » 91 honored (0.142s)