cloudhead/vows — Issue #171: coffeescript test fails from local vows, but not global
Author: bdefore
Created: 2011-12-21 10:19:14+00:00
State: open

I'm running into an issue where my globally installed vows works differently from a local one. Using the classic divide-by-zero vows example, but in coffeescript:

BEGIN FILE
# http://ariejan.net/2011/06/10/vows-and-coffeescript

vows = require 'vows'
assert = require 'assert'

vows
.describe('Division by zero')
.addBatch
'when dividing a number by zero':
topic: -> 42/ 0

'we get Infinity': (topic) ->
assert.equal topic, Infinity

'but when dividing zero by zero':
topic: -> 0 / 0

'we get a value which':
'is not a number': (topic) ->
assert.isNaN topic

'is not equal to itself': (topic) ->
assert.notEqual topic, topic

.export(module)
END FILE

I can install vows (0.6.0) globally and run this:

bash-3.2$ which vows
/Users/bdefore/.nave/installed/0.4.7/bin/vows
bash-3.2$ vows test/* --spec

♢ Division by zero

when dividing a number by zero
✓ we get Infinity
but when dividing zero by zero we get a value which
✓ is not a number
✓ is not equal to itself

✓ OK » 3 honored (0.003s)

But in the same setup where I uninstall vows globally and use a local install, or force the local, I get an error:

bash-3.2$ ./node_modules/vows/bin/vows test/* --spec

/Users/bdefore/Sync/Code/Sandbox/Node/travis-vows-example/test/coffeescript_test.coffee:1
# http://ariejan
^

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:399:25)
at Object..js (module.js:410:10)
at Module.load (module.js:336:31)
at Function._load (module.js:297:12)
at require (module.js:348:19)
at /Users/bdefore/Sync/Code/Sandbox/Node/travis-vows-example/node_modules/vows/bin/vows:496:19
at Array.reduce (native)
at importSuites (/Users/bdefore/Sync/Code/Sandbox/Node/travis-vows-example/node_modules/vows/bin/vows:491:18)
at Object. (/Users/bdefore/Sync/Code/Sandbox/Node/travis-vows-example/node_modules/vows/bin/vows:247:15)
at Module._compile (module.js:404:26)

I can confirm that 'coffee -c coffescript_test.coffee' successfully compiles. Any idea why this is happening?