vulcan 0.2.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -80
- data/lib/vulcan/cli.rb +12 -33
- data/lib/vulcan/version.rb +1 -1
- data/server/bin/make +3 -1
- data/server/lib/spawner.js +4 -9
- data/server/node_modules/connect-form/node_modules/formidable/Readme.md +2 -13
- data/server/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js +7 -19
- data/server/node_modules/connect-form/node_modules/formidable/lib/multipart_parser.js +1 -12
- data/server/node_modules/connect-form/node_modules/formidable/package.json +1 -1
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +10 -0
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +9 -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 +1 -0
- data/server/node_modules/cradle/node_modules/vows/LICENSE +20 -0
- data/server/node_modules/cradle/node_modules/vows/Makefile +7 -0
- data/server/node_modules/cradle/node_modules/vows/README.md +39 -0
- data/server/node_modules/cradle/node_modules/vows/bin/vows +515 -0
- data/server/node_modules/cradle/node_modules/vows/lib/assert/error.js +27 -0
- data/server/node_modules/cradle/node_modules/vows/lib/assert/macros.js +215 -0
- data/server/node_modules/cradle/node_modules/vows/lib/assert/utils.js +77 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows.js +193 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/console.js +131 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/context.js +55 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/file.js +29 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html +2 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html +61 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-html.js +54 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-json.js +54 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-plain.js +38 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/extras.js +28 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/dot-matrix.js +67 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/json.js +16 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/silent.js +8 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/spec.js +44 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/watch.js +39 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/xunit.js +90 -0
- data/server/node_modules/cradle/node_modules/vows/lib/vows/suite.js +319 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/LICENSE +20 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/Makefile +4 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/README.md +72 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/lib/eyes.js +233 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/package.json +14 -0
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/test/eyes-test.js +55 -0
- data/server/node_modules/cradle/node_modules/vows/package.json +14 -0
- data/server/node_modules/cradle/node_modules/vows/test/assert-test.js +135 -0
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/failing.js +18 -0
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/log.js +18 -0
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/passing.js +17 -0
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/stderr.js +18 -0
- data/server/node_modules/cradle/node_modules/vows/test/isolate-test.js +140 -0
- data/server/node_modules/cradle/node_modules/vows/test/testInherit.js +133 -0
- data/server/node_modules/cradle/node_modules/vows/test/vows-error-test.js +51 -0
- data/server/node_modules/cradle/node_modules/vows/test/vows-test.js +374 -0
- data/server/node_modules/cradle/package.json +3 -3
- data/server/node_modules/cradle/test/cache-test.js +7 -6
- data/server/node_modules/cradle/test/cradle-test.js +5 -4
- data/server/node_modules/cradle/test/response-test.js +6 -5
- data/server/node_modules/express/History.md +1 -53
- data/server/node_modules/express/Makefile +9 -3
- data/server/node_modules/express/Readme.md +1 -3
- data/server/node_modules/express/bin/express +66 -65
- data/server/node_modules/express/lib/express.js +1 -1
- data/server/node_modules/express/lib/request.js +9 -23
- data/server/node_modules/express/lib/response.js +2 -3
- data/server/node_modules/express/lib/utils.js +0 -13
- data/server/node_modules/express/lib/view.js +16 -19
- data/server/node_modules/express/lib/view/view.js +1 -2
- data/server/node_modules/express/node_modules/connect/lib/connect.js +1 -1
- data/server/node_modules/express/node_modules/connect/lib/http.js +0 -2
- data/server/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +31 -135
- data/server/node_modules/express/node_modules/connect/lib/middleware/limit.js +1 -5
- 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 +21 -26
- data/server/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +38 -91
- 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 +4 -11
- data/server/node_modules/express/node_modules/connect/package.json +6 -7
- data/server/node_modules/express/node_modules/connect/test.js +31 -44
- data/server/node_modules/express/node_modules/mime/index.js +1 -0
- data/server/node_modules/express/node_modules/mime/mime.js +3 -3
- data/server/node_modules/express/node_modules/mime/{types/mime.types → mime.types} +0 -0
- data/server/node_modules/express/node_modules/mime/{types/node.types → node.types} +0 -17
- data/server/node_modules/express/node_modules/mime/package.json +10 -21
- data/server/node_modules/express/node_modules/mime/test.js +3 -2
- data/server/node_modules/express/node_modules/qs/History.md +0 -11
- data/server/node_modules/express/node_modules/qs/Makefile +3 -1
- data/server/node_modules/express/node_modules/qs/Readme.md +4 -2
- data/server/node_modules/express/node_modules/qs/lib/querystring.js +74 -100
- data/server/node_modules/express/node_modules/qs/package.json +2 -9
- data/server/node_modules/express/node_modules/qs/support/expresso/History.md +128 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/Makefile +53 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/Readme.md +61 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/bin/expresso +856 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/api.html +1080 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.html +377 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.md +290 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/foot.html +3 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/head.html +42 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/lib/bar.js +4 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/lib/foo.js +16 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/package.json +12 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/assert.test.js +91 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/async.test.js +12 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/bar.test.js +13 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/foo.test.js +14 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/http.test.js +146 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/async.test.js +39 -0
- data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/http.test.js +48 -0
- data/server/node_modules/express/node_modules/qs/support/should/History.md +22 -0
- data/server/node_modules/express/node_modules/qs/support/should/Makefile +6 -0
- data/server/node_modules/express/node_modules/qs/support/should/Readme.md +248 -0
- data/server/node_modules/express/node_modules/qs/support/should/examples/runner.js +53 -0
- data/server/node_modules/express/node_modules/qs/support/should/index.js +2 -0
- data/server/node_modules/express/node_modules/qs/support/should/lib/eql.js +91 -0
- data/server/node_modules/express/node_modules/qs/support/should/lib/should.js +548 -0
- data/server/node_modules/express/node_modules/qs/support/should/package.json +8 -0
- data/server/node_modules/express/node_modules/qs/support/should/test/should.test.js +358 -0
- data/server/node_modules/express/node_modules/qs/test/{parse.js → parse.test.js} +2 -1
- data/server/node_modules/express/node_modules/qs/test/{stringify.js → stringify.test.js} +0 -0
- data/server/node_modules/express/package.json +8 -9
- data/server/node_modules/node-uuid/README.md +67 -166
- data/server/node_modules/node-uuid/package.json +3 -5
- data/server/node_modules/node-uuid/{benchmark → test}/benchmark-native.c +0 -0
- data/server/node_modules/node-uuid/test/benchmark.js +27 -0
- data/server/node_modules/node-uuid/test/test.html +0 -3
- data/server/node_modules/node-uuid/test/test.js +57 -214
- data/server/node_modules/node-uuid/uuid.js +56 -225
- data/server/node_modules/restler/README.md +7 -20
- data/server/node_modules/restler/bin/restler +1 -1
- data/server/node_modules/restler/lib/multipartform.js +8 -9
- data/server/node_modules/restler/lib/restler.js +22 -64
- data/server/node_modules/restler/package.json +2 -2
- data/server/node_modules/restler/test/restler.js +2 -22
- data/server/node_modules/restler/test/test_helper.js +1 -20
- data/server/package.json +10 -10
- data/server/web.js +7 -30
- metadata +96 -89
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/file/plain.txt +0 -1
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/js/no-filename.js +0 -3
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile +0 -14
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md +0 -286
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/TODO +0 -3
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js +0 -70
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js +0 -43
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js +0 -48
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/index.js +0 -1
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js +0 -61
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js +0 -377
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js +0 -3
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js +0 -312
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js +0 -25
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js +0 -6
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/package.json +0 -22
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js +0 -19
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt +0 -1
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt +0 -1
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md +0 -3
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +0 -26
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-firefox-3.6.http +0 -24
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-safari-5.http +0 -23
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +0 -24
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-7.http +0 -22
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-8.http +0 -22
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-safari-5.http +0 -22
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js +0 -3
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +0 -21
- 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 +0 -72
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js +0 -89
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js +0 -24
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js +0 -80
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js +0 -104
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +0 -715
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +0 -50
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js +0 -45
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js +0 -72
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js +0 -2
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js +0 -63
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js +0 -47
- data/server/node_modules/express/node_modules/mkdirp/LICENSE +0 -21
- data/server/node_modules/express/node_modules/mkdirp/README.markdown +0 -21
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js +0 -6
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.orig +0 -6
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.rej +0 -19
- data/server/node_modules/express/node_modules/mkdirp/index.js +0 -20
- data/server/node_modules/express/node_modules/mkdirp/package.json +0 -23
- data/server/node_modules/express/node_modules/mkdirp/test/mkdirp.js +0 -28
- data/server/node_modules/express/node_modules/mkdirp/test/race.js +0 -41
- data/server/node_modules/express/node_modules/mkdirp/test/rel.js +0 -32
- data/server/node_modules/express/node_modules/qs/test/mocha.opts +0 -2
- data/server/node_modules/express/testing/foo/app.js +0 -35
- data/server/node_modules/express/testing/foo/package.json +0 -9
- data/server/node_modules/express/testing/foo/public/stylesheets/style.css +0 -8
- data/server/node_modules/express/testing/foo/routes/index.js +0 -10
- data/server/node_modules/express/testing/foo/views/index.jade +0 -2
- data/server/node_modules/express/testing/foo/views/layout.jade +0 -6
- data/server/node_modules/express/testing/index.js +0 -43
- data/server/node_modules/express/testing/public/test.txt +0 -2971
- data/server/node_modules/express/testing/views/page.html +0 -1
- data/server/node_modules/express/testing/views/page.jade +0 -3
- data/server/node_modules/express/testing/views/test.md +0 -1
- data/server/node_modules/express/testing/views/user/index.jade +0 -1
- data/server/node_modules/express/testing/views/user/list.jade +0 -1
- data/server/node_modules/node-uuid/benchmark/README.md +0 -53
- data/server/node_modules/node-uuid/benchmark/bench.gnu +0 -174
- data/server/node_modules/node-uuid/benchmark/bench.sh +0 -34
- data/server/node_modules/node-uuid/benchmark/benchmark.js +0 -84
- data/server/node_modules/node-uuid/test/benchmark-native +0 -0
- data/server/node_modules/node-uuid/test/compare_v1.js +0 -63
@@ -0,0 +1,42 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Expresso - TDD Framework For Node</title>
|
4
|
+
<style>
|
5
|
+
body {
|
6
|
+
font: 13px/1.4 "Helvetica", "Lucida Grande", Arial, sans-serif;
|
7
|
+
text-align: center;
|
8
|
+
}
|
9
|
+
#ribbon {
|
10
|
+
position: absolute;
|
11
|
+
top: 0;
|
12
|
+
right: 0;
|
13
|
+
z-index: 10;
|
14
|
+
}
|
15
|
+
#wrapper {
|
16
|
+
margin: 0 auto;
|
17
|
+
padding: 50px 80px;
|
18
|
+
width: 700px;
|
19
|
+
text-align: left;
|
20
|
+
}
|
21
|
+
h1, h2, h3 {
|
22
|
+
margin: 25px 0 15px 0;
|
23
|
+
}
|
24
|
+
h1 {
|
25
|
+
font-size: 35px;
|
26
|
+
}
|
27
|
+
pre {
|
28
|
+
margin: 0 5px;
|
29
|
+
padding: 15px;
|
30
|
+
border: 1px solid #eee;
|
31
|
+
}
|
32
|
+
a {
|
33
|
+
color: #00aaff;
|
34
|
+
}
|
35
|
+
</style>
|
36
|
+
</head>
|
37
|
+
<body>
|
38
|
+
<a href="http://github.com/visionmedia/expresso">
|
39
|
+
<img alt="Fork me on GitHub" id="ribbon" src="http://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" />
|
40
|
+
</a>
|
41
|
+
<div id="wrapper">
|
42
|
+
<h1>Expresso</h1>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
{ "name": "expresso",
|
2
|
+
"version": "0.7.2",
|
3
|
+
"description": "TDD framework, light-weight, fast, CI-friendly",
|
4
|
+
"author": "TJ Holowaychuk <tj@vision-media.ca>",
|
5
|
+
"bin": {
|
6
|
+
"expresso": "./bin/expresso",
|
7
|
+
"node-jscoverage": "./deps/jscoverage/node-jscoverage"
|
8
|
+
},
|
9
|
+
"scripts": {
|
10
|
+
"preinstall": "make deps/jscoverage/node-jscoverage"
|
11
|
+
}
|
12
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
|
2
|
+
/**
|
3
|
+
* Module dependencies.
|
4
|
+
*/
|
5
|
+
|
6
|
+
var assert = require('assert');
|
7
|
+
|
8
|
+
module.exports = {
|
9
|
+
'assert.eql()': function(){
|
10
|
+
assert.equal(assert.deepEqual, assert.eql);
|
11
|
+
},
|
12
|
+
|
13
|
+
'assert.type()': function(){
|
14
|
+
assert.type('foobar', 'string');
|
15
|
+
assert.type(2, 'number');
|
16
|
+
assert.throws(function(){
|
17
|
+
assert.type([1,2,3], 'string');
|
18
|
+
});
|
19
|
+
},
|
20
|
+
|
21
|
+
'assert.includes()': function(){
|
22
|
+
assert.includes('some random string', 'dom');
|
23
|
+
assert.throws(function(){
|
24
|
+
assert.include('some random string', 'foobar');
|
25
|
+
});
|
26
|
+
|
27
|
+
assert.includes(['foo', 'bar'], 'bar');
|
28
|
+
assert.includes(['foo', 'bar'], 'foo');
|
29
|
+
assert.includes([1,2,3], 3);
|
30
|
+
assert.includes([1,2,3], 2);
|
31
|
+
assert.includes([1,2,3], 1);
|
32
|
+
assert.throws(function(){
|
33
|
+
assert.includes(['foo', 'bar'], 'baz');
|
34
|
+
});
|
35
|
+
|
36
|
+
assert.throws(function(){
|
37
|
+
assert.includes({ wrong: 'type' }, 'foo');
|
38
|
+
});
|
39
|
+
},
|
40
|
+
|
41
|
+
'assert.isNull()': function(){
|
42
|
+
assert.isNull(null);
|
43
|
+
assert.throws(function(){
|
44
|
+
assert.isNull(undefined);
|
45
|
+
});
|
46
|
+
assert.throws(function(){
|
47
|
+
assert.isNull(false);
|
48
|
+
});
|
49
|
+
},
|
50
|
+
|
51
|
+
'assert.isUndefined()': function(){
|
52
|
+
assert.isUndefined(undefined);
|
53
|
+
assert.throws(function(){
|
54
|
+
assert.isUndefined(null);
|
55
|
+
});
|
56
|
+
assert.throws(function(){
|
57
|
+
assert.isUndefined(false);
|
58
|
+
});
|
59
|
+
},
|
60
|
+
|
61
|
+
'assert.isNotNull()': function(){
|
62
|
+
assert.isNotNull(false);
|
63
|
+
assert.isNotNull(undefined);
|
64
|
+
assert.throws(function(){
|
65
|
+
assert.isNotNull(null);
|
66
|
+
});
|
67
|
+
},
|
68
|
+
|
69
|
+
'assert.isDefined()': function(){
|
70
|
+
assert.isDefined(false);
|
71
|
+
assert.isDefined(null);
|
72
|
+
assert.throws(function(){
|
73
|
+
assert.isDefined(undefined);
|
74
|
+
});
|
75
|
+
},
|
76
|
+
|
77
|
+
'assert.match()': function(){
|
78
|
+
assert.match('foobar', /foo(bar)?/);
|
79
|
+
assert.throws(function(){
|
80
|
+
assert.match('something', /rawr/);
|
81
|
+
});
|
82
|
+
},
|
83
|
+
|
84
|
+
'assert.length()': function(){
|
85
|
+
assert.length('test', 4);
|
86
|
+
assert.length([1,2,3,4], 4);
|
87
|
+
assert.throws(function(){
|
88
|
+
assert.length([1,2,3], 4);
|
89
|
+
});
|
90
|
+
}
|
91
|
+
};
|
@@ -0,0 +1,146 @@
|
|
1
|
+
|
2
|
+
/**
|
3
|
+
* Module dependencies.
|
4
|
+
*/
|
5
|
+
|
6
|
+
var assert = require('assert')
|
7
|
+
, http = require('http');
|
8
|
+
|
9
|
+
var server = http.createServer(function(req, res){
|
10
|
+
if (req.method === 'GET') {
|
11
|
+
if (req.url === '/delay') {
|
12
|
+
setTimeout(function(){
|
13
|
+
res.writeHead(200, {});
|
14
|
+
res.end('delayed');
|
15
|
+
}, 200);
|
16
|
+
} else {
|
17
|
+
var body = JSON.stringify({ name: 'tj' });
|
18
|
+
res.writeHead(200, {
|
19
|
+
'Content-Type': 'application/json; charset=utf8',
|
20
|
+
'Content-Length': body.length
|
21
|
+
});
|
22
|
+
res.end(body);
|
23
|
+
}
|
24
|
+
} else {
|
25
|
+
var body = '';
|
26
|
+
req.setEncoding('utf8');
|
27
|
+
req.on('data', function(chunk){ body += chunk });
|
28
|
+
req.on('end', function(){
|
29
|
+
res.writeHead(200, {});
|
30
|
+
res.end(req.url + ' ' + body);
|
31
|
+
});
|
32
|
+
}
|
33
|
+
});
|
34
|
+
|
35
|
+
var delayedServer = http.createServer(function(req, res){
|
36
|
+
res.writeHead(200);
|
37
|
+
res.end('it worked');
|
38
|
+
});
|
39
|
+
|
40
|
+
var oldListen = delayedServer.listen;
|
41
|
+
delayedServer.listen = function(){
|
42
|
+
var args = arguments;
|
43
|
+
setTimeout(function(){
|
44
|
+
oldListen.apply(delayedServer, args);
|
45
|
+
}, 100);
|
46
|
+
};
|
47
|
+
|
48
|
+
module.exports = {
|
49
|
+
'test assert.response(req, res, fn)': function(beforeExit){
|
50
|
+
var calls = 0;
|
51
|
+
|
52
|
+
assert.response(server, {
|
53
|
+
url: '/',
|
54
|
+
method: 'GET'
|
55
|
+
},{
|
56
|
+
body: '{"name":"tj"}',
|
57
|
+
status: 200,
|
58
|
+
headers: {
|
59
|
+
'Content-Type': 'application/json; charset=utf8'
|
60
|
+
}
|
61
|
+
}, function(res){
|
62
|
+
++calls;
|
63
|
+
assert.ok(res);
|
64
|
+
});
|
65
|
+
|
66
|
+
beforeExit(function(){
|
67
|
+
assert.equal(1, calls);
|
68
|
+
})
|
69
|
+
},
|
70
|
+
|
71
|
+
'test assert.response(req, fn)': function(beforeExit){
|
72
|
+
var calls = 0;
|
73
|
+
|
74
|
+
assert.response(server, {
|
75
|
+
url: '/foo'
|
76
|
+
}, function(res){
|
77
|
+
++calls;
|
78
|
+
assert.ok(res.body.indexOf('tj') >= 0, 'Test assert.response() callback');
|
79
|
+
});
|
80
|
+
|
81
|
+
beforeExit(function(){
|
82
|
+
assert.equal(1, calls);
|
83
|
+
});
|
84
|
+
},
|
85
|
+
|
86
|
+
'test assert.response() delay': function(beforeExit){
|
87
|
+
var calls = 0;
|
88
|
+
|
89
|
+
assert.response(server,
|
90
|
+
{ url: '/delay', timeout: 1500 },
|
91
|
+
{ body: 'delayed' },
|
92
|
+
function(){
|
93
|
+
++calls;
|
94
|
+
});
|
95
|
+
|
96
|
+
beforeExit(function(){
|
97
|
+
assert.equal(1, calls);
|
98
|
+
});
|
99
|
+
},
|
100
|
+
|
101
|
+
'test assert.response() regexp': function(beforeExit){
|
102
|
+
var calls = 0;
|
103
|
+
|
104
|
+
assert.response(server,
|
105
|
+
{ url: '/foo', method: 'POST', data: 'foobar' },
|
106
|
+
{ body: /^\/foo foo(bar)?/ },
|
107
|
+
function(){
|
108
|
+
++calls;
|
109
|
+
});
|
110
|
+
|
111
|
+
beforeExit(function(){
|
112
|
+
assert.equal(1, calls);
|
113
|
+
});
|
114
|
+
},
|
115
|
+
|
116
|
+
'test assert.response() regexp headers': function(beforeExit){
|
117
|
+
var calls = 0;
|
118
|
+
|
119
|
+
assert.response(server,
|
120
|
+
{ url: '/' },
|
121
|
+
{ body: '{"name":"tj"}', headers: { 'Content-Type': /^application\/json/ } },
|
122
|
+
function(){
|
123
|
+
++calls;
|
124
|
+
});
|
125
|
+
|
126
|
+
beforeExit(function(){
|
127
|
+
assert.equal(1, calls);
|
128
|
+
});
|
129
|
+
},
|
130
|
+
|
131
|
+
// [!] if this test doesn't pass, an uncaught ECONNREFUSED will display
|
132
|
+
'test assert.response() with deferred listen()': function(beforeExit){
|
133
|
+
var calls = 0;
|
134
|
+
|
135
|
+
assert.response(delayedServer,
|
136
|
+
{ url: '/' },
|
137
|
+
{ body: 'it worked' },
|
138
|
+
function(){
|
139
|
+
++calls;
|
140
|
+
});
|
141
|
+
|
142
|
+
beforeExit(function(){
|
143
|
+
assert.equal(1, calls);
|
144
|
+
});
|
145
|
+
}
|
146
|
+
};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
var assert = require('assert')
|
3
|
+
, setup = 0
|
4
|
+
, order = [];
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
setup: function(done){
|
8
|
+
++setup;
|
9
|
+
done();
|
10
|
+
},
|
11
|
+
|
12
|
+
a: function(done){
|
13
|
+
assert.equal(1, setup);
|
14
|
+
order.push('a');
|
15
|
+
setTimeout(function(){
|
16
|
+
done();
|
17
|
+
}, 500);
|
18
|
+
},
|
19
|
+
|
20
|
+
b: function(done){
|
21
|
+
assert.equal(2, setup);
|
22
|
+
order.push('b');
|
23
|
+
setTimeout(function(){
|
24
|
+
done();
|
25
|
+
}, 200);
|
26
|
+
},
|
27
|
+
|
28
|
+
c: function(done){
|
29
|
+
assert.equal(3, setup);
|
30
|
+
order.push('c');
|
31
|
+
setTimeout(function(){
|
32
|
+
done();
|
33
|
+
}, 1000);
|
34
|
+
},
|
35
|
+
|
36
|
+
d: function(){
|
37
|
+
assert.eql(order, ['a', 'b', 'c']);
|
38
|
+
}
|
39
|
+
};
|
@@ -0,0 +1,48 @@
|
|
1
|
+
|
2
|
+
/**
|
3
|
+
* Module dependencies.
|
4
|
+
*/
|
5
|
+
|
6
|
+
var assert = require('assert')
|
7
|
+
, http = require('http');
|
8
|
+
|
9
|
+
var server = http.createServer(function(req, res){
|
10
|
+
if (req.method === 'GET') {
|
11
|
+
if (req.url === '/delay') {
|
12
|
+
setTimeout(function(){
|
13
|
+
res.writeHead(200, {});
|
14
|
+
res.end('delayed');
|
15
|
+
}, 200);
|
16
|
+
} else {
|
17
|
+
var body = JSON.stringify({ name: 'tj' });
|
18
|
+
res.writeHead(200, {
|
19
|
+
'Content-Type': 'application/json; charset=utf8',
|
20
|
+
'Content-Length': body.length
|
21
|
+
});
|
22
|
+
res.end(body);
|
23
|
+
}
|
24
|
+
} else {
|
25
|
+
var body = '';
|
26
|
+
req.setEncoding('utf8');
|
27
|
+
req.addListener('data', function(chunk){ body += chunk });
|
28
|
+
req.addListener('end', function(){
|
29
|
+
res.writeHead(200, {});
|
30
|
+
res.end(req.url + ' ' + body);
|
31
|
+
});
|
32
|
+
}
|
33
|
+
});
|
34
|
+
|
35
|
+
module.exports = {
|
36
|
+
'test assert.response()': function(done){
|
37
|
+
assert.response(server, {
|
38
|
+
url: '/',
|
39
|
+
method: 'GET'
|
40
|
+
},{
|
41
|
+
body: '{"name":"tj"}',
|
42
|
+
status: 200,
|
43
|
+
headers: {
|
44
|
+
'Content-Type': 'application/json; charset=utf8'
|
45
|
+
}
|
46
|
+
}, done);
|
47
|
+
}
|
48
|
+
};
|