Skip to content

Commit e1a0bc5

Browse files
committed
More CLI tests
1 parent f50247c commit e1a0bc5

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

test/cli.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,38 @@ var execFile = require('child_process').execFile;
1313
var suite = vows.describe('cli');
1414

1515
suite.addBatch({
16-
'sanity': {
16+
'defaults': {
1717
topic: function () {
1818
execFile(path.join(__dirname, '..', 'bin', 'cpplint'), [
1919
path.join(__dirname, 'fixtures', 'node-cpp-hello.cpp')
2020
], null, this.callback);
2121
},
2222

23-
'should run successfully': function (error, stdout, stderr) {
24-
assert.isNull(error);
23+
'should run successfully': function (err, stdout, stderr) {
24+
assert.isNull(err);
2525
assert.isString(stdout);
2626
assert.isEmpty(stderr);
27+
},
28+
29+
'default verbosity is 1': function (err, stdout, stderr) {
30+
var lines = stdout.split('\n');
31+
assert.lengthOf(lines, 7);
32+
},
33+
34+
'default reporter is spec': function (err, stdout, stderr) {
35+
var lines = stdout.split('\n');
36+
assert.match(lines[0], //);
37+
assert.match(lines[0], /node\-cpp\-hello\.cpp/);
38+
},
39+
40+
'default filters is no filters': function (err, stdout, stderr) {
41+
var lines = stdout.split('\n');
42+
assert.lengthOf(lines, 7);
43+
},
44+
45+
'default extensions is no extensions': function (err, stdout, stderr) {
46+
var lines = stdout.split('\n');
47+
assert.lengthOf(lines, 7);
2748
}
2849
}
2950
});

0 commit comments

Comments
 (0)