vulcan 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. data/README.md +1 -80
  2. data/lib/vulcan/cli.rb +12 -33
  3. data/lib/vulcan/version.rb +1 -1
  4. data/server/bin/make +3 -1
  5. data/server/lib/spawner.js +4 -9
  6. data/server/node_modules/connect-form/node_modules/formidable/Readme.md +2 -13
  7. data/server/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js +7 -19
  8. data/server/node_modules/connect-form/node_modules/formidable/lib/multipart_parser.js +1 -12
  9. data/server/node_modules/connect-form/node_modules/formidable/package.json +1 -1
  10. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +10 -0
  11. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +9 -0
  12. data/server/node_modules/connect-form/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +1 -1
  13. data/server/node_modules/cradle/lib/cradle.js +1 -0
  14. data/server/node_modules/cradle/node_modules/vows/LICENSE +20 -0
  15. data/server/node_modules/cradle/node_modules/vows/Makefile +7 -0
  16. data/server/node_modules/cradle/node_modules/vows/README.md +39 -0
  17. data/server/node_modules/cradle/node_modules/vows/bin/vows +515 -0
  18. data/server/node_modules/cradle/node_modules/vows/lib/assert/error.js +27 -0
  19. data/server/node_modules/cradle/node_modules/vows/lib/assert/macros.js +215 -0
  20. data/server/node_modules/cradle/node_modules/vows/lib/assert/utils.js +77 -0
  21. data/server/node_modules/cradle/node_modules/vows/lib/vows.js +193 -0
  22. data/server/node_modules/cradle/node_modules/vows/lib/vows/console.js +131 -0
  23. data/server/node_modules/cradle/node_modules/vows/lib/vows/context.js +55 -0
  24. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/file.js +29 -0
  25. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html +2 -0
  26. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html +61 -0
  27. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-html.js +54 -0
  28. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-json.js +54 -0
  29. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-plain.js +38 -0
  30. data/server/node_modules/cradle/node_modules/vows/lib/vows/extras.js +28 -0
  31. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/dot-matrix.js +67 -0
  32. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/json.js +16 -0
  33. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/silent.js +8 -0
  34. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/spec.js +44 -0
  35. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/watch.js +39 -0
  36. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/xunit.js +90 -0
  37. data/server/node_modules/cradle/node_modules/vows/lib/vows/suite.js +319 -0
  38. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/LICENSE +20 -0
  39. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/Makefile +4 -0
  40. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/README.md +72 -0
  41. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/lib/eyes.js +233 -0
  42. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/package.json +14 -0
  43. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/test/eyes-test.js +55 -0
  44. data/server/node_modules/cradle/node_modules/vows/package.json +14 -0
  45. data/server/node_modules/cradle/node_modules/vows/test/assert-test.js +135 -0
  46. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/failing.js +18 -0
  47. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/log.js +18 -0
  48. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/passing.js +17 -0
  49. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/stderr.js +18 -0
  50. data/server/node_modules/cradle/node_modules/vows/test/isolate-test.js +140 -0
  51. data/server/node_modules/cradle/node_modules/vows/test/testInherit.js +133 -0
  52. data/server/node_modules/cradle/node_modules/vows/test/vows-error-test.js +51 -0
  53. data/server/node_modules/cradle/node_modules/vows/test/vows-test.js +374 -0
  54. data/server/node_modules/cradle/package.json +3 -3
  55. data/server/node_modules/cradle/test/cache-test.js +7 -6
  56. data/server/node_modules/cradle/test/cradle-test.js +5 -4
  57. data/server/node_modules/cradle/test/response-test.js +6 -5
  58. data/server/node_modules/express/History.md +1 -53
  59. data/server/node_modules/express/Makefile +9 -3
  60. data/server/node_modules/express/Readme.md +1 -3
  61. data/server/node_modules/express/bin/express +66 -65
  62. data/server/node_modules/express/lib/express.js +1 -1
  63. data/server/node_modules/express/lib/request.js +9 -23
  64. data/server/node_modules/express/lib/response.js +2 -3
  65. data/server/node_modules/express/lib/utils.js +0 -13
  66. data/server/node_modules/express/lib/view.js +16 -19
  67. data/server/node_modules/express/lib/view/view.js +1 -2
  68. data/server/node_modules/express/node_modules/connect/lib/connect.js +1 -1
  69. data/server/node_modules/express/node_modules/connect/lib/http.js +0 -2
  70. data/server/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +31 -135
  71. data/server/node_modules/express/node_modules/connect/lib/middleware/limit.js +1 -5
  72. data/server/node_modules/express/node_modules/connect/lib/middleware/session.js +2 -2
  73. data/server/node_modules/express/node_modules/connect/lib/middleware/static.js +21 -26
  74. data/server/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +38 -91
  75. data/server/node_modules/express/node_modules/connect/lib/middleware/vhost.js +1 -1
  76. data/server/node_modules/express/node_modules/connect/lib/utils.js +4 -11
  77. data/server/node_modules/express/node_modules/connect/package.json +6 -7
  78. data/server/node_modules/express/node_modules/connect/test.js +31 -44
  79. data/server/node_modules/express/node_modules/mime/index.js +1 -0
  80. data/server/node_modules/express/node_modules/mime/mime.js +3 -3
  81. data/server/node_modules/express/node_modules/mime/{types/mime.types → mime.types} +0 -0
  82. data/server/node_modules/express/node_modules/mime/{types/node.types → node.types} +0 -17
  83. data/server/node_modules/express/node_modules/mime/package.json +10 -21
  84. data/server/node_modules/express/node_modules/mime/test.js +3 -2
  85. data/server/node_modules/express/node_modules/qs/History.md +0 -11
  86. data/server/node_modules/express/node_modules/qs/Makefile +3 -1
  87. data/server/node_modules/express/node_modules/qs/Readme.md +4 -2
  88. data/server/node_modules/express/node_modules/qs/lib/querystring.js +74 -100
  89. data/server/node_modules/express/node_modules/qs/package.json +2 -9
  90. data/server/node_modules/express/node_modules/qs/support/expresso/History.md +128 -0
  91. data/server/node_modules/express/node_modules/qs/support/expresso/Makefile +53 -0
  92. data/server/node_modules/express/node_modules/qs/support/expresso/Readme.md +61 -0
  93. data/server/node_modules/express/node_modules/qs/support/expresso/bin/expresso +856 -0
  94. data/server/node_modules/express/node_modules/qs/support/expresso/docs/api.html +1080 -0
  95. data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.html +377 -0
  96. data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.md +290 -0
  97. data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/foot.html +3 -0
  98. data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/head.html +42 -0
  99. data/server/node_modules/express/node_modules/qs/support/expresso/lib/bar.js +4 -0
  100. data/server/node_modules/express/node_modules/qs/support/expresso/lib/foo.js +16 -0
  101. data/server/node_modules/express/node_modules/qs/support/expresso/package.json +12 -0
  102. data/server/node_modules/express/node_modules/qs/support/expresso/test/assert.test.js +91 -0
  103. data/server/node_modules/express/node_modules/qs/support/expresso/test/async.test.js +12 -0
  104. data/server/node_modules/express/node_modules/qs/support/expresso/test/bar.test.js +13 -0
  105. data/server/node_modules/express/node_modules/qs/support/expresso/test/foo.test.js +14 -0
  106. data/server/node_modules/express/node_modules/qs/support/expresso/test/http.test.js +146 -0
  107. data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/async.test.js +39 -0
  108. data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/http.test.js +48 -0
  109. data/server/node_modules/express/node_modules/qs/support/should/History.md +22 -0
  110. data/server/node_modules/express/node_modules/qs/support/should/Makefile +6 -0
  111. data/server/node_modules/express/node_modules/qs/support/should/Readme.md +248 -0
  112. data/server/node_modules/express/node_modules/qs/support/should/examples/runner.js +53 -0
  113. data/server/node_modules/express/node_modules/qs/support/should/index.js +2 -0
  114. data/server/node_modules/express/node_modules/qs/support/should/lib/eql.js +91 -0
  115. data/server/node_modules/express/node_modules/qs/support/should/lib/should.js +548 -0
  116. data/server/node_modules/express/node_modules/qs/support/should/package.json +8 -0
  117. data/server/node_modules/express/node_modules/qs/support/should/test/should.test.js +358 -0
  118. data/server/node_modules/express/node_modules/qs/test/{parse.js → parse.test.js} +2 -1
  119. data/server/node_modules/express/node_modules/qs/test/{stringify.js → stringify.test.js} +0 -0
  120. data/server/node_modules/express/package.json +8 -9
  121. data/server/node_modules/node-uuid/README.md +67 -166
  122. data/server/node_modules/node-uuid/package.json +3 -5
  123. data/server/node_modules/node-uuid/{benchmark → test}/benchmark-native.c +0 -0
  124. data/server/node_modules/node-uuid/test/benchmark.js +27 -0
  125. data/server/node_modules/node-uuid/test/test.html +0 -3
  126. data/server/node_modules/node-uuid/test/test.js +57 -214
  127. data/server/node_modules/node-uuid/uuid.js +56 -225
  128. data/server/node_modules/restler/README.md +7 -20
  129. data/server/node_modules/restler/bin/restler +1 -1
  130. data/server/node_modules/restler/lib/multipartform.js +8 -9
  131. data/server/node_modules/restler/lib/restler.js +22 -64
  132. data/server/node_modules/restler/package.json +2 -2
  133. data/server/node_modules/restler/test/restler.js +2 -22
  134. data/server/node_modules/restler/test/test_helper.js +1 -20
  135. data/server/package.json +10 -10
  136. data/server/web.js +7 -30
  137. metadata +96 -89
  138. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/file/plain.txt +0 -1
  139. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
  140. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/js/no-filename.js +0 -3
  141. data/server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile +0 -14
  142. data/server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md +0 -286
  143. data/server/node_modules/express/node_modules/connect/node_modules/formidable/TODO +0 -3
  144. data/server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js +0 -70
  145. data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js +0 -43
  146. data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js +0 -48
  147. data/server/node_modules/express/node_modules/connect/node_modules/formidable/index.js +0 -1
  148. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js +0 -61
  149. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js +0 -377
  150. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js +0 -3
  151. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js +0 -312
  152. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js +0 -25
  153. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js +0 -6
  154. data/server/node_modules/express/node_modules/connect/node_modules/formidable/package.json +0 -22
  155. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js +0 -19
  156. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt +0 -1
  157. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt +0 -1
  158. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
  159. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md +0 -3
  160. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +0 -26
  161. 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
  162. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-safari-5.http +0 -23
  163. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +0 -24
  164. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-7.http +0 -22
  165. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-8.http +0 -22
  166. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-safari-5.http +0 -22
  167. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js +0 -3
  168. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +0 -21
  169. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multi_video.upload +0 -0
  170. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js +0 -72
  171. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js +0 -89
  172. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js +0 -24
  173. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js +0 -80
  174. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js +0 -104
  175. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +0 -715
  176. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +0 -50
  177. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js +0 -45
  178. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js +0 -72
  179. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js +0 -2
  180. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js +0 -63
  181. data/server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js +0 -47
  182. data/server/node_modules/express/node_modules/mkdirp/LICENSE +0 -21
  183. data/server/node_modules/express/node_modules/mkdirp/README.markdown +0 -21
  184. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js +0 -6
  185. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.orig +0 -6
  186. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.rej +0 -19
  187. data/server/node_modules/express/node_modules/mkdirp/index.js +0 -20
  188. data/server/node_modules/express/node_modules/mkdirp/package.json +0 -23
  189. data/server/node_modules/express/node_modules/mkdirp/test/mkdirp.js +0 -28
  190. data/server/node_modules/express/node_modules/mkdirp/test/race.js +0 -41
  191. data/server/node_modules/express/node_modules/mkdirp/test/rel.js +0 -32
  192. data/server/node_modules/express/node_modules/qs/test/mocha.opts +0 -2
  193. data/server/node_modules/express/testing/foo/app.js +0 -35
  194. data/server/node_modules/express/testing/foo/package.json +0 -9
  195. data/server/node_modules/express/testing/foo/public/stylesheets/style.css +0 -8
  196. data/server/node_modules/express/testing/foo/routes/index.js +0 -10
  197. data/server/node_modules/express/testing/foo/views/index.jade +0 -2
  198. data/server/node_modules/express/testing/foo/views/layout.jade +0 -6
  199. data/server/node_modules/express/testing/index.js +0 -43
  200. data/server/node_modules/express/testing/public/test.txt +0 -2971
  201. data/server/node_modules/express/testing/views/page.html +0 -1
  202. data/server/node_modules/express/testing/views/page.jade +0 -3
  203. data/server/node_modules/express/testing/views/test.md +0 -1
  204. data/server/node_modules/express/testing/views/user/index.jade +0 -1
  205. data/server/node_modules/express/testing/views/user/list.jade +0 -1
  206. data/server/node_modules/node-uuid/benchmark/README.md +0 -53
  207. data/server/node_modules/node-uuid/benchmark/bench.gnu +0 -174
  208. data/server/node_modules/node-uuid/benchmark/bench.sh +0 -34
  209. data/server/node_modules/node-uuid/benchmark/benchmark.js +0 -84
  210. data/server/node_modules/node-uuid/test/benchmark-native +0 -0
  211. 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,4 @@
1
+
2
+ exports.bar = function(msg){
3
+ return msg || 'bar';
4
+ };
@@ -0,0 +1,16 @@
1
+
2
+ exports.foo = function(msg){
3
+ if (msg) {
4
+ return msg;
5
+ } else {
6
+ return generateFoo();
7
+ }
8
+ };
9
+
10
+ function generateFoo() {
11
+ return 'foo';
12
+ }
13
+
14
+ function Foo(msg){
15
+ this.msg = msg || 'foo';
16
+ }
@@ -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,12 @@
1
+
2
+ /**
3
+ * Module dependencies.
4
+ */
5
+
6
+ var assert = require('assert');
7
+
8
+ setTimeout(function(){
9
+ exports['test async exports'] = function(){
10
+ assert.ok('wahoo');
11
+ };
12
+ }, 100);
@@ -0,0 +1,13 @@
1
+
2
+ /**
3
+ * Module dependencies.
4
+ */
5
+
6
+ var assert = require('assert')
7
+ , bar = require('bar');
8
+
9
+ module.exports = {
10
+ 'bar()': function(){
11
+ assert.equal('bar', bar.bar());
12
+ }
13
+ };
@@ -0,0 +1,14 @@
1
+
2
+ /**
3
+ * Module dependencies.
4
+ */
5
+
6
+ var assert = require('assert')
7
+ , foo = require('foo');
8
+
9
+ module.exports = {
10
+ 'foo()': function(){
11
+ assert.equal('foo', foo.foo());
12
+ assert.equal('foo', foo.foo());
13
+ }
14
+ };
@@ -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
+ };