Skip to content

Commit 02577cd

Browse files
Aaron Garveyjbpros
Aaron Garvey
authored andcommitted
Replace findit with walkdir (close #73)
This fixes step definition and support code loading on Windows.
1 parent 5d4c2d2 commit 02577cd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: lib/cucumber/cli/argument_parser/path_expander.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var fs = require('fs');
22
var _ = require('underscore');
3-
var findit = require('findit');
3+
var walk = require('walkdir');
44

55
var PathExpander = {
66
expandPathsWithRegexp: function expandPathsWithRegexp(paths, regexp) {
@@ -26,7 +26,7 @@ var PathExpander = {
2626

2727
expandDirectoryWithRegexp: function expandDirectoryWithRegexp(directory, regexp) {
2828
var paths = [];
29-
var scannedPaths = findit.sync(directory);
29+
var scannedPaths = walk.sync(directory);
3030
scannedPaths.forEach(function(path) {
3131
if (regexp.test(path))
3232
paths.push(path);

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
, "rimraf" : "2.0.2"
3636
, "mkdirp" : "0.3.3"
3737
, "cucumber-html": "0.2.0"
38-
, "findit": "0.1.2"
38+
, "walkdir": "0.0.4"
3939
, "coffee-script": "1.3.3"
4040
}
4141
, "scripts" :

Diff for: spec/cucumber/cli/argument_parser/path_expander_spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,19 @@ describe("Cucumber.Cli.ArgumentParser.PathExpander", function() {
9393
});
9494

9595
describe("expandDirectoryWithRegexp()", function() {
96-
var findit = require('findit');
96+
var walkdir = require('walkdir');
9797
var directory, regexp, innerPaths;
9898

9999
beforeEach(function() {
100100
directory = createSpy("directory");
101101
regexp = createSpyWithStubs("regexp", {test: null});
102102
innerPaths = [createSpy("inner path 1"), createSpy("inner path 2"), createSpy("inner path 3")];
103-
spyOn(findit, 'sync').andReturn(innerPaths);
103+
spyOn(walkdir, 'sync').andReturn(innerPaths);
104104
});
105105

106106
it("recursively finds the directory inner paths", function() {
107107
PathExpander.expandDirectoryWithRegexp(directory, regexp);
108-
expect(findit.sync).toHaveBeenCalledWith(directory);
108+
expect(walkdir.sync).toHaveBeenCalledWith(directory);
109109
});
110110

111111
it("tests the regexp against each inner path", function() {

0 commit comments

Comments
 (0)