jenius/roots — pull request #134 by Hoverbear (2013-05-12 07:00:11+00:00)
Title: Allow spaces in file names during testing.

Without spaces:

> roots@1.2.4 test /Users/Hoverbear/roots
> mocha

command
compile
✓ should compile files to /public
✓ should minify all css and javascript
✓ should compile all files to public
new
✓ should use the default template if no flags present (907ms)
✓ should use express template if the --express flag is present (915ms)
✓ should use basic template if the --basic flag is present (900ms)
plugin
✓ should create a template inside /plugins on 'generate' (896ms)
✓ should use the javascript template if called with --js (894ms)
version
✓ should output the correct version number for roots (892ms)
js
✓ should expose bower's interface (898ms)

compiler
✓ eventemitter should be hooked up properly

jade
✓ should compile jade view templates (924ms)

ejs
✓ should compile ejs (913ms)

coffeescript
✓ should compile coffeescript and requires should work (919ms)
✓ should compile without closures when specified in app.coffee (908ms)

stylus
✓ should compile stylus with roots css
✓ should include the project directory for requires

static files
✓ copies static files

errors
✓ notifies you if theres an error (936ms)

dynamic content
✓ compiles dynamic files

deploy
✓ handles adapters correctly
✓ has all the required shell methods

22 tests complete (17 seconds)

With spaces:

> roots@1.2.4 test /Users/Hoverbear/Git Repos/roots
> mocha

command
compile
1) "before all" hook

✖ 1 of 22 tests failed:

1) command compile "before all" hook:
Error: Command failed: /bin/sh: line 0: cd: /Users/Hoverbear/Git: No such file or directory
/bin/sh: ../../../bin/roots: No such file or directory

at ChildProcess.exithandler (child_process.js:632:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:730:16)
at Socket. (child_process.js:943:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:451:12)

npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0

It appears that the test file will trip up as it executes `child_process.exec()` commands since the file paths are not escaped properly. Solving the problem involved wrapping `#{basic_root}` and `#{root}` in `\"`'s.