Skip to content

Commit

Permalink
use node-glob instead of wildcard for better pattern support
Browse files Browse the repository at this point in the history
node-glob is located here: <https://github.com/isaacs/node-glob>
It supports common filename glob patterns, including patterns
like: `'**/*.js'`.  This commit allows vows to be called, for
example, like this: `vows --spec '**/test-*.js'`.
  • Loading branch information
coltrane committed Feb 25, 2013
1 parent a7843f4 commit 8e4c8b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 122 deletions.
10 changes: 3 additions & 7 deletions bin/vows
Expand Up @@ -4,7 +4,7 @@
var path = require('path'), var path = require('path'),
fs = require('fs'), fs = require('fs'),
util = require('util'), util = require('util'),
wildcard = require('../lib/utils/wildcard').wildcard, glob = require('glob'),
NopStream = require('../lib/utils/nopstream').NopStream, NopStream = require('../lib/utils/nopstream').NopStream,
events = require('events'); events = require('events');


Expand Down Expand Up @@ -270,12 +270,8 @@ if (! options.watch) {
// preprocess the list of files for any wildcards. win32 does not handle wildcards before calling vows // preprocess the list of files for any wildcards. win32 does not handle wildcards before calling vows
// any paths not containing wildcards are simple returned by wildcard() // any paths not containing wildcards are simple returned by wildcard()
files.forEach(function(a) { files.forEach(function(a) {
if(a.indexOf('*') !== -1) { wildcardFiles = wildcardFiles.concat(glob.sync(a));
wildcardFiles = wildcardFiles.concat(wildcard(a)); });
} else {
wildcardFiles.push(a);
}
});


// now set up the file list for vows including all the wildcard files // now set up the file list for vows including all the wildcard files
files = wildcardFiles.map(function (a) { files = wildcardFiles.map(function (a) {
Expand Down
114 changes: 0 additions & 114 deletions lib/utils/wildcard.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -5,7 +5,7 @@
"keywords" : ["testing", "spec", "test", "BDD"], "keywords" : ["testing", "spec", "test", "BDD"],
"author" : "Alexis Sellier <self@cloudhead.net>", "author" : "Alexis Sellier <self@cloudhead.net>",
"contributors" : [{ "name": "Charlie Robbins", "email": "charlie.robbins@gmail.com" }], "contributors" : [{ "name": "Charlie Robbins", "email": "charlie.robbins@gmail.com" }],
"dependencies" : {"eyes": ">=0.1.6", "diff": "~1.0.3"}, "dependencies" : {"eyes": ">=0.1.6", "diff": "~1.0.3", "glob": "3.1.x"},
"main" : "./lib/vows", "main" : "./lib/vows",
"bin" : {"vows": "./bin/vows"}, "bin" : {"vows": "./bin/vows"},
"directories" : {"test": "./test", "bin": "./bin"}, "directories" : {"test": "./test", "bin": "./bin"},
Expand Down

0 comments on commit 8e4c8b8

Please sign in to comment.