visionmedia/mocha — pull request #439 by jimmycuadra (2012-05-29 01:20:07+00:00)
Title: Allow directories to be passed to bin/mocha.

When I started using Mocha today, I was confused by the fact that running `mocha spec` (my specs are in a folder called "spec") threw an exception right away. After digging into what it was doing, I discovered that the assumes that all non-option arguments are files.

This patch updates the file list parsing and generation code in the CLI to allow both files and directories as arguments to `mocha`. It also reuses the same functionality to default to a "test" folder if no non-option arguments are supplied, just as it does now.

I also added some more user-friendly error messages when attempting to run Mocha against a non-existent directory.