vulcan 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/vulcan +3 -1
- data/lib/vulcan/cli.rb +22 -3
- data/lib/vulcan/version.rb +1 -1
- data/server/bin/make +1 -3
- data/server/lib/spawner.js +9 -4
- data/server/node_modules/connect-form/node_modules/formidable/Readme.md +13 -2
- data/server/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js +19 -7
- data/server/node_modules/connect-form/node_modules/formidable/lib/multipart_parser.js +12 -1
- data/server/node_modules/connect-form/node_modules/formidable/package.json +1 -1
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/file/plain.txt +1 -0
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/no-filename/generic.http +13 -0
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +0 -10
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +0 -9
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/js/no-filename.js +3 -0
- data/server/node_modules/connect-form/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +1 -1
- data/server/node_modules/cradle/lib/cradle.js +0 -1
- data/server/node_modules/cradle/package.json +3 -3
- data/server/node_modules/cradle/test/cache-test.js +6 -7
- data/server/node_modules/cradle/test/cradle-test.js +4 -5
- data/server/node_modules/cradle/test/response-test.js +5 -6
- data/server/node_modules/express/History.md +53 -1
- data/server/node_modules/express/Makefile +3 -9
- data/server/node_modules/express/Readme.md +3 -1
- data/server/node_modules/express/bin/express +65 -66
- data/server/node_modules/express/lib/express.js +1 -1
- data/server/node_modules/express/lib/request.js +23 -9
- data/server/node_modules/express/lib/response.js +3 -2
- data/server/node_modules/express/lib/utils.js +13 -0
- data/server/node_modules/express/lib/view/view.js +2 -1
- data/server/node_modules/express/lib/view.js +19 -16
- data/server/node_modules/express/node_modules/connect/lib/connect.js +1 -1
- data/server/node_modules/express/node_modules/connect/lib/http.js +2 -0
- data/server/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +135 -31
- data/server/node_modules/express/node_modules/connect/lib/middleware/limit.js +5 -1
- data/server/node_modules/express/node_modules/connect/lib/middleware/session.js +2 -2
- data/server/node_modules/express/node_modules/connect/lib/middleware/static.js +26 -21
- data/server/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +91 -38
- data/server/node_modules/express/node_modules/connect/lib/middleware/vhost.js +1 -1
- data/server/node_modules/express/node_modules/connect/lib/utils.js +11 -4
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile +14 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md +286 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/TODO +3 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js +70 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js +43 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js +48 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/index.js +1 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js +61 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js +377 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js +3 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js +312 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js +25 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js +6 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/package.json +22 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js +19 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt +1 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt +1 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/generic.http +13 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md +3 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +26 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-firefox-3.6.http +24 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-safari-5.http +23 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +24 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-7.http +22 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-8.http +22 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-safari-5.http +22 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js +3 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +21 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multi_video.upload +0 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js +72 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js +89 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js +24 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js +80 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js +104 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +715 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +50 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js +45 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js +72 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js +2 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js +63 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js +47 -0
- data/server/node_modules/express/node_modules/connect/package.json +7 -6
- data/server/node_modules/express/node_modules/connect/test.js +44 -31
- data/server/node_modules/express/node_modules/mime/mime.js +3 -3
- data/server/node_modules/express/node_modules/mime/package.json +21 -10
- data/server/node_modules/express/node_modules/mime/test.js +2 -3
- data/server/node_modules/express/node_modules/mime/{mime.types → types/mime.types} +0 -0
- data/server/node_modules/express/node_modules/mime/{node.types → types/node.types} +17 -0
- data/server/node_modules/express/node_modules/mkdirp/LICENSE +21 -0
- data/server/node_modules/express/node_modules/mkdirp/README.markdown +21 -0
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js +6 -0
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.orig +6 -0
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.rej +19 -0
- data/server/node_modules/express/node_modules/mkdirp/index.js +20 -0
- data/server/node_modules/express/node_modules/mkdirp/package.json +23 -0
- data/server/node_modules/express/node_modules/mkdirp/test/mkdirp.js +28 -0
- data/server/node_modules/express/node_modules/mkdirp/test/race.js +41 -0
- data/server/node_modules/express/node_modules/mkdirp/test/rel.js +32 -0
- data/server/node_modules/express/node_modules/qs/History.md +11 -0
- data/server/node_modules/express/node_modules/qs/Makefile +1 -3
- data/server/node_modules/express/node_modules/qs/Readme.md +2 -4
- data/server/node_modules/express/node_modules/qs/lib/querystring.js +100 -74
- data/server/node_modules/express/node_modules/qs/package.json +9 -2
- data/server/node_modules/express/node_modules/qs/test/mocha.opts +2 -0
- data/server/node_modules/express/node_modules/qs/test/{parse.test.js → parse.js} +1 -2
- data/server/node_modules/express/node_modules/qs/test/{stringify.test.js → stringify.js} +0 -0
- data/server/node_modules/express/package.json +9 -8
- data/server/node_modules/express/testing/foo/app.js +35 -0
- data/server/node_modules/express/testing/foo/package.json +9 -0
- data/server/node_modules/express/testing/foo/public/stylesheets/style.css +8 -0
- data/server/node_modules/express/testing/foo/routes/index.js +10 -0
- data/server/node_modules/express/testing/foo/views/index.jade +2 -0
- data/server/node_modules/express/testing/foo/views/layout.jade +6 -0
- data/server/node_modules/express/testing/index.js +43 -0
- data/server/node_modules/express/testing/public/test.txt +2971 -0
- data/server/node_modules/express/testing/views/page.html +1 -0
- data/server/node_modules/express/testing/views/page.jade +3 -0
- data/server/node_modules/express/testing/views/test.md +1 -0
- data/server/node_modules/express/testing/views/user/index.jade +1 -0
- data/server/node_modules/express/testing/views/user/list.jade +1 -0
- data/server/node_modules/node-uuid/README.md +166 -67
- data/server/node_modules/node-uuid/benchmark/README.md +53 -0
- data/server/node_modules/node-uuid/benchmark/bench.gnu +174 -0
- data/server/node_modules/node-uuid/benchmark/bench.sh +34 -0
- data/server/node_modules/node-uuid/{test → benchmark}/benchmark-native.c +0 -0
- data/server/node_modules/node-uuid/benchmark/benchmark.js +84 -0
- data/server/node_modules/node-uuid/package.json +5 -3
- data/server/node_modules/node-uuid/test/benchmark-native +0 -0
- data/server/node_modules/node-uuid/test/compare_v1.js +63 -0
- data/server/node_modules/node-uuid/test/test.html +3 -0
- data/server/node_modules/node-uuid/test/test.js +214 -57
- data/server/node_modules/node-uuid/uuid.js +225 -56
- data/server/node_modules/restler/README.md +20 -7
- data/server/node_modules/restler/bin/restler +1 -1
- data/server/node_modules/restler/lib/multipartform.js +9 -8
- data/server/node_modules/restler/lib/restler.js +64 -22
- data/server/node_modules/restler/package.json +2 -2
- data/server/node_modules/restler/test/restler.js +22 -2
- data/server/node_modules/restler/test/test_helper.js +20 -1
- data/server/package.json +1 -2
- data/server/web.js +30 -7
- metadata +90 -86
- data/server/node_modules/cradle/node_modules/vows/LICENSE +0 -20
- data/server/node_modules/cradle/node_modules/vows/Makefile +0 -7
- data/server/node_modules/cradle/node_modules/vows/README.md +0 -39
- data/server/node_modules/cradle/node_modules/vows/bin/vows +0 -515
- data/server/node_modules/cradle/node_modules/vows/lib/assert/error.js +0 -27
- data/server/node_modules/cradle/node_modules/vows/lib/assert/macros.js +0 -215
- data/server/node_modules/cradle/node_modules/vows/lib/assert/utils.js +0 -77
- data/server/node_modules/cradle/node_modules/vows/lib/vows/console.js +0 -131
- data/server/node_modules/cradle/node_modules/vows/lib/vows/context.js +0 -55
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/file.js +0 -29
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html +0 -2
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html +0 -61
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-html.js +0 -54
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-json.js +0 -54
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-plain.js +0 -38
- data/server/node_modules/cradle/node_modules/vows/lib/vows/extras.js +0 -28
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/dot-matrix.js +0 -67
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/json.js +0 -16
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/silent.js +0 -8
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/spec.js +0 -44
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/watch.js +0 -39
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/xunit.js +0 -90
- data/server/node_modules/cradle/node_modules/vows/lib/vows/suite.js +0 -319
- data/server/node_modules/cradle/node_modules/vows/lib/vows.js +0 -193
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/LICENSE +0 -20
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/Makefile +0 -4
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/README.md +0 -72
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/lib/eyes.js +0 -233
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/package.json +0 -14
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/test/eyes-test.js +0 -55
- data/server/node_modules/cradle/node_modules/vows/package.json +0 -14
- data/server/node_modules/cradle/node_modules/vows/test/assert-test.js +0 -135
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/failing.js +0 -18
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/log.js +0 -18
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/passing.js +0 -17
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/stderr.js +0 -18
- data/server/node_modules/cradle/node_modules/vows/test/isolate-test.js +0 -140
- data/server/node_modules/cradle/node_modules/vows/test/testInherit.js +0 -133
- data/server/node_modules/cradle/node_modules/vows/test/vows-error-test.js +0 -51
- data/server/node_modules/cradle/node_modules/vows/test/vows-test.js +0 -374
- data/server/node_modules/express/node_modules/mime/index.js +0 -1
- data/server/node_modules/express/node_modules/qs/support/expresso/History.md +0 -128
- data/server/node_modules/express/node_modules/qs/support/expresso/Makefile +0 -53
- data/server/node_modules/express/node_modules/qs/support/expresso/Readme.md +0 -61
- data/server/node_modules/express/node_modules/qs/support/expresso/bin/expresso +0 -856
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/api.html +0 -1080
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.html +0 -377
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.md +0 -290
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/foot.html +0 -3
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/head.html +0 -42
- data/server/node_modules/express/node_modules/qs/support/expresso/lib/bar.js +0 -4
- data/server/node_modules/express/node_modules/qs/support/expresso/lib/foo.js +0 -16
- data/server/node_modules/express/node_modules/qs/support/expresso/package.json +0 -12
- data/server/node_modules/express/node_modules/qs/support/expresso/test/assert.test.js +0 -91
- data/server/node_modules/express/node_modules/qs/support/expresso/test/async.test.js +0 -12
- data/server/node_modules/express/node_modules/qs/support/expresso/test/bar.test.js +0 -13
- data/server/node_modules/express/node_modules/qs/support/expresso/test/foo.test.js +0 -14
- data/server/node_modules/express/node_modules/qs/support/expresso/test/http.test.js +0 -146
- data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/async.test.js +0 -39
- data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/http.test.js +0 -48
- data/server/node_modules/express/node_modules/qs/support/should/History.md +0 -22
- data/server/node_modules/express/node_modules/qs/support/should/Makefile +0 -6
- data/server/node_modules/express/node_modules/qs/support/should/Readme.md +0 -248
- data/server/node_modules/express/node_modules/qs/support/should/examples/runner.js +0 -53
- data/server/node_modules/express/node_modules/qs/support/should/index.js +0 -2
- data/server/node_modules/express/node_modules/qs/support/should/lib/eql.js +0 -91
- data/server/node_modules/express/node_modules/qs/support/should/lib/should.js +0 -548
- data/server/node_modules/express/node_modules/qs/support/should/package.json +0 -8
- data/server/node_modules/express/node_modules/qs/support/should/test/should.test.js +0 -358
- data/server/node_modules/node-uuid/test/benchmark.js +0 -27
@@ -1,135 +0,0 @@
|
|
1
|
-
var vows = require('../lib/vows');
|
2
|
-
var assert = require('assert');
|
3
|
-
|
4
|
-
vows.describe('vows/assert').addBatch({
|
5
|
-
"The Assertion module": {
|
6
|
-
topic: require('assert'),
|
7
|
-
|
8
|
-
"`equal`": function (assert) {
|
9
|
-
assert.equal("hello world", "hello world");
|
10
|
-
assert.equal(1, true);
|
11
|
-
},
|
12
|
-
"`match`": function (assert) {
|
13
|
-
assert.match("hello world", /^[a-z]+ [a-z]+$/);
|
14
|
-
},
|
15
|
-
"`length`": function (assert) {
|
16
|
-
assert.length("hello world", 11);
|
17
|
-
assert.length([1, 2, 3], 3);
|
18
|
-
},
|
19
|
-
"`isDefined`": function (assert) {
|
20
|
-
assert.isDefined(null);
|
21
|
-
assertError(assert.isDefined, undefined);
|
22
|
-
},
|
23
|
-
"`include`": function (assert) {
|
24
|
-
assert.include("hello world", "world");
|
25
|
-
assert.include([0, 42, 0], 42);
|
26
|
-
assert.include({goo:true}, 'goo');
|
27
|
-
},
|
28
|
-
"`deepInclude`": function (assert) {
|
29
|
-
assert.deepInclude([{a:'b'},{c:'d'}], {a:'b'});
|
30
|
-
assert.deepInclude("hello world", "world");
|
31
|
-
assert.deepInclude({goo:true}, 'goo');
|
32
|
-
},
|
33
|
-
"`typeOf`": function (assert) {
|
34
|
-
assert.typeOf('goo', 'string');
|
35
|
-
assert.typeOf(42, 'number');
|
36
|
-
assert.typeOf([], 'array');
|
37
|
-
assert.typeOf({}, 'object');
|
38
|
-
assert.typeOf(false, 'boolean');
|
39
|
-
},
|
40
|
-
"`instanceOf`": function (assert) {
|
41
|
-
assert.instanceOf([], Array);
|
42
|
-
assert.instanceOf(function () {}, Function);
|
43
|
-
},
|
44
|
-
"`isArray`": function (assert) {
|
45
|
-
assert.isArray([]);
|
46
|
-
assertError(assert.isArray, {});
|
47
|
-
},
|
48
|
-
"`isString`": function (assert) {
|
49
|
-
assert.isString("");
|
50
|
-
},
|
51
|
-
"`isObject`": function (assert) {
|
52
|
-
assert.isObject({});
|
53
|
-
assertError(assert.isObject, []);
|
54
|
-
},
|
55
|
-
"`isNumber`": function (assert) {
|
56
|
-
assert.isNumber(0);
|
57
|
-
},
|
58
|
-
"`isBoolean`": function (assert){
|
59
|
-
assert.isBoolean(true);
|
60
|
-
assert.isBoolean(false);
|
61
|
-
assertError(assert.isBoolean, 0);
|
62
|
-
},
|
63
|
-
"`isNan`": function (assert) {
|
64
|
-
assert.isNaN(0/0);
|
65
|
-
},
|
66
|
-
"`isTrue`": function (assert) {
|
67
|
-
assert.isTrue(true);
|
68
|
-
assertError(assert.isTrue, 1);
|
69
|
-
},
|
70
|
-
"`isFalse`": function (assert) {
|
71
|
-
assert.isFalse(false);
|
72
|
-
assertError(assert.isFalse, 0);
|
73
|
-
},
|
74
|
-
"`isZero`": function (assert) {
|
75
|
-
assert.isZero(0);
|
76
|
-
assertError(assert.isZero, null);
|
77
|
-
},
|
78
|
-
"`isNotZero`": function (assert) {
|
79
|
-
assert.isNotZero(1);
|
80
|
-
},
|
81
|
-
"`isUndefined`": function (assert) {
|
82
|
-
assert.isUndefined(undefined);
|
83
|
-
assertError(assert.isUndefined, null);
|
84
|
-
},
|
85
|
-
"`isDefined`": function (assert) {
|
86
|
-
assert.isDefined(null);
|
87
|
-
assertError(assert.isDefined, undefined);
|
88
|
-
},
|
89
|
-
"`isNull`": function (assert) {
|
90
|
-
assert.isNull(null);
|
91
|
-
assertError(assert.isNull, 0);
|
92
|
-
assertError(assert.isNull, undefined);
|
93
|
-
},
|
94
|
-
"`isNotNull`": function (assert) {
|
95
|
-
assert.isNotNull(0);
|
96
|
-
},
|
97
|
-
"`greater` and `lesser`": function (assert) {
|
98
|
-
assert.greater(5, 4);
|
99
|
-
assert.lesser(4, 5);
|
100
|
-
},
|
101
|
-
"`inDelta`": function (assert) {
|
102
|
-
assert.inDelta(42, 40, 5);
|
103
|
-
assert.inDelta(42, 40, 2);
|
104
|
-
assert.inDelta(42, 42, 0);
|
105
|
-
assert.inDelta(3.1, 3.0, 0.2);
|
106
|
-
assertError(assert.inDelta, [42, 40, 1]);
|
107
|
-
},
|
108
|
-
"`isEmpty`": function (assert) {
|
109
|
-
assert.isEmpty({});
|
110
|
-
assert.isEmpty([]);
|
111
|
-
assert.isEmpty("");
|
112
|
-
},
|
113
|
-
"`isNotEmpty`": function (assert) {
|
114
|
-
assert.isNotEmpty({goo:true});
|
115
|
-
assert.isNotEmpty([1]);
|
116
|
-
assert.isNotEmpty(" ");
|
117
|
-
assertError(assert.isNotEmpty, {});
|
118
|
-
assertError(assert.isNotEmpty, []);
|
119
|
-
assertError(assert.isNotEmpty, "");
|
120
|
-
}
|
121
|
-
}
|
122
|
-
}).export(module);
|
123
|
-
|
124
|
-
function assertError(assertion, args, fail) {
|
125
|
-
if (!Array.isArray(args)) { args = [args]; }
|
126
|
-
try {
|
127
|
-
assertion.apply(null, args);
|
128
|
-
fail = true;
|
129
|
-
} catch (e) {/* Success */}
|
130
|
-
|
131
|
-
fail && assert.fail(args.join(' '), assert.AssertionError,
|
132
|
-
"expected an AssertionError for {actual}",
|
133
|
-
"assertError", assertError);
|
134
|
-
}
|
135
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
var vows = require('../../../lib/vows'),
|
2
|
-
assert = require('assert');
|
3
|
-
|
4
|
-
var obvious;
|
5
|
-
vows.describe('failing').addBatch({
|
6
|
-
'Obvious test': obvious = {
|
7
|
-
topic: function () {
|
8
|
-
this.callback(null, false);
|
9
|
-
},
|
10
|
-
'should work': function (result) {
|
11
|
-
assert.ok(result);
|
12
|
-
}
|
13
|
-
// but it won't
|
14
|
-
},
|
15
|
-
'Obvious test #2': obvious,
|
16
|
-
'Obvious test #3': obvious,
|
17
|
-
'Obvious test #4': obvious
|
18
|
-
}).export(module);
|
@@ -1,18 +0,0 @@
|
|
1
|
-
var vows = require('../../../lib/vows'),
|
2
|
-
assert = require('assert');
|
3
|
-
|
4
|
-
var obvious;
|
5
|
-
vows.describe('stderr').addBatch({
|
6
|
-
'Obvious test': obvious = {
|
7
|
-
topic: function () {
|
8
|
-
this.callback(null, true);
|
9
|
-
},
|
10
|
-
'should work': function (result) {
|
11
|
-
console.log('oh no!');
|
12
|
-
assert.ok(result);
|
13
|
-
}
|
14
|
-
},
|
15
|
-
'Obvious test #2': obvious,
|
16
|
-
'Obvious test #3': obvious,
|
17
|
-
'Obvious test #4': obvious
|
18
|
-
}).export(module);
|
@@ -1,17 +0,0 @@
|
|
1
|
-
var vows = require('../../../lib/vows'),
|
2
|
-
assert = require('assert');
|
3
|
-
|
4
|
-
var obvious;
|
5
|
-
vows.describe('passing').addBatch({
|
6
|
-
'Obvious test': obvious = {
|
7
|
-
topic: function () {
|
8
|
-
this.callback(null, true);
|
9
|
-
},
|
10
|
-
'should work': function (result) {
|
11
|
-
assert.ok(result);
|
12
|
-
}
|
13
|
-
},
|
14
|
-
'Obvious test #2': obvious,
|
15
|
-
'Obvious test #3': obvious,
|
16
|
-
'Obvious test #4': obvious
|
17
|
-
}).export(module);
|
@@ -1,18 +0,0 @@
|
|
1
|
-
var vows = require('../../../lib/vows'),
|
2
|
-
assert = require('assert');
|
3
|
-
|
4
|
-
var obvious;
|
5
|
-
vows.describe('stderr').addBatch({
|
6
|
-
'Obvious test': obvious = {
|
7
|
-
topic: function () {
|
8
|
-
this.callback(null, true);
|
9
|
-
},
|
10
|
-
'should work': function (result) {
|
11
|
-
console.error('oh no!');
|
12
|
-
assert.ok(result);
|
13
|
-
}
|
14
|
-
},
|
15
|
-
'Obvious test #2': obvious,
|
16
|
-
'Obvious test #3': obvious,
|
17
|
-
'Obvious test #4': obvious
|
18
|
-
}).export(module);
|
@@ -1,140 +0,0 @@
|
|
1
|
-
var vows = require('../lib/vows'),
|
2
|
-
assert = require('assert'),
|
3
|
-
path = require('path'),
|
4
|
-
exec = require('child_process').exec;
|
5
|
-
|
6
|
-
function generateTopic(args, file) {
|
7
|
-
return function () {
|
8
|
-
var cmd = './bin/vows' + ' -i ' + (args || '') +
|
9
|
-
' ./test/fixtures/isolate/' + file,
|
10
|
-
options = {cwd: path.resolve(__dirname + '/../')},
|
11
|
-
callback = this.callback;
|
12
|
-
|
13
|
-
exec(cmd, options, function (err, stdout, stderr) {
|
14
|
-
callback(null, {
|
15
|
-
err: err,
|
16
|
-
stdout: stdout,
|
17
|
-
stderr: stderr
|
18
|
-
});
|
19
|
-
});
|
20
|
-
}
|
21
|
-
};
|
22
|
-
|
23
|
-
function assertExecOk(r) {
|
24
|
-
assert.isNull(r.err);
|
25
|
-
}
|
26
|
-
|
27
|
-
function assertExecNotOk(r) {
|
28
|
-
assert.isNotNull(r.err);
|
29
|
-
}
|
30
|
-
|
31
|
-
function parseResults(stdout) {
|
32
|
-
return stdout.split(/\n/g).map(function (s) {
|
33
|
-
if (!s) return;
|
34
|
-
return JSON.parse(s);
|
35
|
-
}).filter(function (s) {return s});
|
36
|
-
}
|
37
|
-
|
38
|
-
function assertResultTypePresent(results, type) {
|
39
|
-
assert.ok(results.some(function (result) {
|
40
|
-
return result[0] == type;
|
41
|
-
}));
|
42
|
-
}
|
43
|
-
|
44
|
-
function assertResultsFinish(results, expected) {
|
45
|
-
var finish = results[results.length - 1];
|
46
|
-
assert.equal(finish[0], 'finish');
|
47
|
-
|
48
|
-
finish = finish[1];
|
49
|
-
|
50
|
-
Object.keys(expected).forEach(function (key) {
|
51
|
-
assert.equal(finish[key], expected[key]);
|
52
|
-
});
|
53
|
-
}
|
54
|
-
|
55
|
-
vows.describe('vows/isolate').addBatch({
|
56
|
-
'Running vows with -i flag for test/fixtures/isolate/': {
|
57
|
-
'passing.js': {
|
58
|
-
'with default reporter': {
|
59
|
-
topic: generateTopic(null, 'passing.js'),
|
60
|
-
'should be ok': assertExecOk
|
61
|
-
},
|
62
|
-
'with json reporter': {
|
63
|
-
topic: generateTopic('--json', 'passing.js'),
|
64
|
-
'should be ok': assertExecOk,
|
65
|
-
'should have correct output': function (r) {
|
66
|
-
var results = parseResults(r.stdout)
|
67
|
-
|
68
|
-
assertResultTypePresent(results, 'subject');
|
69
|
-
assertResultTypePresent(results, 'end');
|
70
|
-
|
71
|
-
assertResultsFinish(results, {
|
72
|
-
total: 4,
|
73
|
-
honored: 4
|
74
|
-
});
|
75
|
-
}
|
76
|
-
}
|
77
|
-
},
|
78
|
-
'failing.js': {
|
79
|
-
'with json reporter': {
|
80
|
-
topic: generateTopic('--json', 'failing.js'),
|
81
|
-
'should be not ok': assertExecNotOk,
|
82
|
-
'should have correct output though': function (r) {
|
83
|
-
var results = parseResults(r.stdout);
|
84
|
-
|
85
|
-
assertResultsFinish(results, {
|
86
|
-
total: 4,
|
87
|
-
broken: 4
|
88
|
-
});
|
89
|
-
}
|
90
|
-
}
|
91
|
-
},
|
92
|
-
'stderr.js': {
|
93
|
-
'with json reporter': {
|
94
|
-
topic: generateTopic('--json', 'stderr.js'),
|
95
|
-
'should be ok': assertExecOk,
|
96
|
-
'should have stderr': function (r) {
|
97
|
-
assert.equal(r.stderr,
|
98
|
-
['oh no!', 'oh no!', 'oh no!', 'oh no!', ''].join('\n'));
|
99
|
-
},
|
100
|
-
'should have correct output': function (r) {
|
101
|
-
var results= parseResults(r.stdout);
|
102
|
-
|
103
|
-
assertResultsFinish(results, {
|
104
|
-
total: 4,
|
105
|
-
honored: 4
|
106
|
-
});
|
107
|
-
}
|
108
|
-
}
|
109
|
-
},
|
110
|
-
'log.js': {
|
111
|
-
'with json reporter': {
|
112
|
-
topic: generateTopic('--json', 'log.js'),
|
113
|
-
'should be ok': assertExecOk,
|
114
|
-
'should have correct output': function (r) {
|
115
|
-
var results= parseResults(r.stdout);
|
116
|
-
|
117
|
-
assertResultsFinish(results, {
|
118
|
-
total: 4,
|
119
|
-
honored: 4
|
120
|
-
});
|
121
|
-
}
|
122
|
-
}
|
123
|
-
},
|
124
|
-
'all tests (*)': {
|
125
|
-
'with json reporter': {
|
126
|
-
topic: generateTopic('--json', '*'),
|
127
|
-
'should be not ok': assertExecNotOk,
|
128
|
-
'should have correct output': function (r) {
|
129
|
-
var results= parseResults(r.stdout);
|
130
|
-
|
131
|
-
assertResultsFinish(results, {
|
132
|
-
total: 16,
|
133
|
-
broken: 4,
|
134
|
-
honored: 12
|
135
|
-
});
|
136
|
-
}
|
137
|
-
}
|
138
|
-
}
|
139
|
-
}
|
140
|
-
}).export(module);
|
@@ -1,133 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* instanceof is a more complete check then .constructor ===
|
3
|
-
*
|
4
|
-
* It works when using node's built-in util.inherits function
|
5
|
-
* and it also honors a class's entire ancestry
|
6
|
-
*
|
7
|
-
* Here I am only testing the change to vows in suite.js at line 147 to change
|
8
|
-
* the check from .constructor === to instanceof. These tests should demonstrate
|
9
|
-
* that this change should work both cases. For completness I also check
|
10
|
-
* the case when EventEmitter is an ancestor, not the parent Class.
|
11
|
-
*
|
12
|
-
*/
|
13
|
-
var EventEmitter = process.EventEmitter,
|
14
|
-
util = require('util'),
|
15
|
-
vows = require('vows'),
|
16
|
-
assert = require('assert');
|
17
|
-
|
18
|
-
vows.describe('EventEmitters as a return value from a topic').addBatch({
|
19
|
-
'returning an EventEmitter' : {
|
20
|
-
topic : function () {
|
21
|
-
//Make an event emitter
|
22
|
-
var tmp = new EventEmitter();
|
23
|
-
//set it to emit success in a bit
|
24
|
-
setTimeout(function () {
|
25
|
-
//pass a value to make sure this all works
|
26
|
-
tmp.emit('success', 'I work');
|
27
|
-
}, 10);
|
28
|
-
|
29
|
-
return tmp;
|
30
|
-
},
|
31
|
-
'will catch what I pass to success' : function (ret) {
|
32
|
-
assert.strictEqual(ret, 'I work');
|
33
|
-
}
|
34
|
-
},
|
35
|
-
'returning a class that uses util.inherit to inherit from EventEmitter' : {
|
36
|
-
topic : function () {
|
37
|
-
//Make a class that will util.inherit from EventEmitter
|
38
|
-
var Class = function () {
|
39
|
-
EventEmitter.call(this);
|
40
|
-
},
|
41
|
-
tmp;
|
42
|
-
|
43
|
-
//inherit from EventEmitter
|
44
|
-
util.inherits(Class, EventEmitter);
|
45
|
-
//Get a new one
|
46
|
-
tmp = new Class();
|
47
|
-
//set it to emit success in a bit
|
48
|
-
setTimeout(function () {
|
49
|
-
//pass a value to make sure this all works
|
50
|
-
tmp.emit('success', 'I work');
|
51
|
-
}, 10);
|
52
|
-
|
53
|
-
return tmp;
|
54
|
-
},
|
55
|
-
'will catch what I pass to success' : function (ret) {
|
56
|
-
assert.strictEqual(ret, 'I work');
|
57
|
-
}
|
58
|
-
},
|
59
|
-
'returning a class that uses Class.prototype = new EventEmitter()' : {
|
60
|
-
topic : function () {
|
61
|
-
//Make a class that will inherit from EventEmitter
|
62
|
-
var Class = function () {}, tmp;
|
63
|
-
//inherit
|
64
|
-
Class.prototype = new EventEmitter();
|
65
|
-
//Get a new one
|
66
|
-
tmp = new Class();
|
67
|
-
//set it to emit success in a bit
|
68
|
-
setTimeout(function () {
|
69
|
-
//pass a value to make sure this all works
|
70
|
-
tmp.emit('success', 'I work');
|
71
|
-
}, 10);
|
72
|
-
|
73
|
-
return tmp;
|
74
|
-
},
|
75
|
-
'will catch what I pass to success' : function (ret) {
|
76
|
-
assert.strictEqual(ret, 'I work');
|
77
|
-
}
|
78
|
-
},
|
79
|
-
'returning a class that uses util.inherit to inherit from a class that inherits from EventEmitter ' : {
|
80
|
-
topic : function () {
|
81
|
-
//Class1 inherits from EventEmitter
|
82
|
-
var Class1 = function () {
|
83
|
-
var self = this;
|
84
|
-
EventEmitter.call(self);
|
85
|
-
},
|
86
|
-
//Class2 inherits from Class1
|
87
|
-
Class2 = function () {
|
88
|
-
Class1.call(this);
|
89
|
-
}, tmp;
|
90
|
-
//Inherit
|
91
|
-
util.inherits(Class1, EventEmitter);
|
92
|
-
util.inherits(Class2, Class1);
|
93
|
-
//Get a new one
|
94
|
-
tmp = new Class2();
|
95
|
-
//set it to emit success in a bit
|
96
|
-
setTimeout(function () {
|
97
|
-
//pass a value to make sure this all works
|
98
|
-
tmp.emit('success', 'I work');
|
99
|
-
},10);
|
100
|
-
|
101
|
-
return tmp;
|
102
|
-
},
|
103
|
-
'will catch what I pass to success' : function (ret) {
|
104
|
-
assert.strictEqual(ret, 'I work');
|
105
|
-
}
|
106
|
-
},
|
107
|
-
'returning a class that uses Class2.prototype = new Class1() and Class1.prototype = new EventEmitter()' : {
|
108
|
-
topic : function () {
|
109
|
-
//Class1 will inherit from EventEmitter
|
110
|
-
var Class1 = function () {},
|
111
|
-
//Class2 will inherit from Class1
|
112
|
-
Class2 = function () {}, tmp;
|
113
|
-
//Inherit
|
114
|
-
Class1.prototype = new EventEmitter();
|
115
|
-
Class2.prototype = new Class1();
|
116
|
-
//Get a new one
|
117
|
-
tmp = new Class2();
|
118
|
-
//seit it to emit success in a bit
|
119
|
-
setTimeout(function () {
|
120
|
-
//pass a value to make sure this all works
|
121
|
-
tmp.emit('success', 'I work');
|
122
|
-
},10);
|
123
|
-
|
124
|
-
return tmp;
|
125
|
-
},
|
126
|
-
'will catch what I pass to success' : function (ret) {
|
127
|
-
assert.strictEqual(ret, 'I work');
|
128
|
-
}
|
129
|
-
}
|
130
|
-
}).export(module);
|
131
|
-
|
132
|
-
|
133
|
-
|
@@ -1,51 +0,0 @@
|
|
1
|
-
var path = require('path'),
|
2
|
-
events = require('events'),
|
3
|
-
assert = require('assert'),
|
4
|
-
fs = require('fs'),
|
5
|
-
vows = require('../lib/vows');
|
6
|
-
|
7
|
-
function doSomethingAsync(callback) {
|
8
|
-
var err = null;
|
9
|
-
var testValue = 'a';
|
10
|
-
|
11
|
-
process.nextTick(function() {
|
12
|
-
callback(err, testValue);
|
13
|
-
});
|
14
|
-
}
|
15
|
-
|
16
|
-
function doSomethingAsyncWithError(callback) {
|
17
|
-
var err = true;
|
18
|
-
var testValue = 'a';
|
19
|
-
|
20
|
-
process.nextTick(function() {
|
21
|
-
callback(err, testValue);
|
22
|
-
});
|
23
|
-
}
|
24
|
-
|
25
|
-
|
26
|
-
vows.describe('vows/error').addBatch({
|
27
|
-
'Generate success response to async function': {
|
28
|
-
topic: function() {
|
29
|
-
doSomethingAsync(this.callback)
|
30
|
-
},
|
31
|
-
'Validate success': function(err, testValue) {
|
32
|
-
assert.ok(!err);
|
33
|
-
},
|
34
|
-
'Validate testValue': function(err, testValue) {
|
35
|
-
assert.equal(testValue, 'a');
|
36
|
-
}
|
37
|
-
},
|
38
|
-
|
39
|
-
'Generate error response to async function': {
|
40
|
-
topic: function() {
|
41
|
-
doSomethingAsyncWithError(this.callback)
|
42
|
-
},
|
43
|
-
'Validate error': function(err, testValue) {
|
44
|
-
assert.ok(err);
|
45
|
-
},
|
46
|
-
'Validate testValue': function(err, testValue) {
|
47
|
-
// This assertion fails. It shouldn't.
|
48
|
-
assert.equal(testValue, 'a');
|
49
|
-
}
|
50
|
-
}
|
51
|
-
}).export(module)
|