vulcan 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. data/bin/vulcan +3 -1
  2. data/lib/vulcan/cli.rb +22 -3
  3. data/lib/vulcan/version.rb +1 -1
  4. data/server/bin/make +1 -3
  5. data/server/lib/spawner.js +9 -4
  6. data/server/node_modules/connect-form/node_modules/formidable/Readme.md +13 -2
  7. data/server/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js +19 -7
  8. data/server/node_modules/connect-form/node_modules/formidable/lib/multipart_parser.js +12 -1
  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/file/plain.txt +1 -0
  11. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/no-filename/generic.http +13 -0
  12. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +0 -10
  13. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +0 -9
  14. data/server/node_modules/connect-form/node_modules/formidable/test/fixture/js/no-filename.js +3 -0
  15. data/server/node_modules/connect-form/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +1 -1
  16. data/server/node_modules/cradle/lib/cradle.js +0 -1
  17. data/server/node_modules/cradle/package.json +3 -3
  18. data/server/node_modules/cradle/test/cache-test.js +6 -7
  19. data/server/node_modules/cradle/test/cradle-test.js +4 -5
  20. data/server/node_modules/cradle/test/response-test.js +5 -6
  21. data/server/node_modules/express/History.md +53 -1
  22. data/server/node_modules/express/Makefile +3 -9
  23. data/server/node_modules/express/Readme.md +3 -1
  24. data/server/node_modules/express/bin/express +65 -66
  25. data/server/node_modules/express/lib/express.js +1 -1
  26. data/server/node_modules/express/lib/request.js +23 -9
  27. data/server/node_modules/express/lib/response.js +3 -2
  28. data/server/node_modules/express/lib/utils.js +13 -0
  29. data/server/node_modules/express/lib/view/view.js +2 -1
  30. data/server/node_modules/express/lib/view.js +19 -16
  31. data/server/node_modules/express/node_modules/connect/lib/connect.js +1 -1
  32. data/server/node_modules/express/node_modules/connect/lib/http.js +2 -0
  33. data/server/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +135 -31
  34. data/server/node_modules/express/node_modules/connect/lib/middleware/limit.js +5 -1
  35. data/server/node_modules/express/node_modules/connect/lib/middleware/session.js +2 -2
  36. data/server/node_modules/express/node_modules/connect/lib/middleware/static.js +26 -21
  37. data/server/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +91 -38
  38. data/server/node_modules/express/node_modules/connect/lib/middleware/vhost.js +1 -1
  39. data/server/node_modules/express/node_modules/connect/lib/utils.js +11 -4
  40. data/server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile +14 -0
  41. data/server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md +286 -0
  42. data/server/node_modules/express/node_modules/connect/node_modules/formidable/TODO +3 -0
  43. data/server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js +70 -0
  44. data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js +43 -0
  45. data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js +48 -0
  46. data/server/node_modules/express/node_modules/connect/node_modules/formidable/index.js +1 -0
  47. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js +61 -0
  48. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js +377 -0
  49. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js +3 -0
  50. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js +312 -0
  51. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js +25 -0
  52. data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js +6 -0
  53. data/server/node_modules/express/node_modules/connect/node_modules/formidable/package.json +22 -0
  54. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js +19 -0
  55. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt +1 -0
  56. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt +1 -0
  57. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/generic.http +13 -0
  58. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md +3 -0
  59. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +26 -0
  60. 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
  61. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-safari-5.http +23 -0
  62. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +24 -0
  63. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-7.http +22 -0
  64. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-8.http +22 -0
  65. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-safari-5.http +22 -0
  66. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js +3 -0
  67. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +21 -0
  68. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multi_video.upload +0 -0
  69. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js +72 -0
  70. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js +89 -0
  71. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js +24 -0
  72. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js +80 -0
  73. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js +104 -0
  74. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +715 -0
  75. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +50 -0
  76. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js +45 -0
  77. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js +72 -0
  78. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js +2 -0
  79. data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js +63 -0
  80. data/server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js +47 -0
  81. data/server/node_modules/express/node_modules/connect/package.json +7 -6
  82. data/server/node_modules/express/node_modules/connect/test.js +44 -31
  83. data/server/node_modules/express/node_modules/mime/mime.js +3 -3
  84. data/server/node_modules/express/node_modules/mime/package.json +21 -10
  85. data/server/node_modules/express/node_modules/mime/test.js +2 -3
  86. data/server/node_modules/express/node_modules/mime/{mime.types → types/mime.types} +0 -0
  87. data/server/node_modules/express/node_modules/mime/{node.types → types/node.types} +17 -0
  88. data/server/node_modules/express/node_modules/mkdirp/LICENSE +21 -0
  89. data/server/node_modules/express/node_modules/mkdirp/README.markdown +21 -0
  90. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js +6 -0
  91. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.orig +6 -0
  92. data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.rej +19 -0
  93. data/server/node_modules/express/node_modules/mkdirp/index.js +20 -0
  94. data/server/node_modules/express/node_modules/mkdirp/package.json +23 -0
  95. data/server/node_modules/express/node_modules/mkdirp/test/mkdirp.js +28 -0
  96. data/server/node_modules/express/node_modules/mkdirp/test/race.js +41 -0
  97. data/server/node_modules/express/node_modules/mkdirp/test/rel.js +32 -0
  98. data/server/node_modules/express/node_modules/qs/History.md +11 -0
  99. data/server/node_modules/express/node_modules/qs/Makefile +1 -3
  100. data/server/node_modules/express/node_modules/qs/Readme.md +2 -4
  101. data/server/node_modules/express/node_modules/qs/lib/querystring.js +100 -74
  102. data/server/node_modules/express/node_modules/qs/package.json +9 -2
  103. data/server/node_modules/express/node_modules/qs/test/mocha.opts +2 -0
  104. data/server/node_modules/express/node_modules/qs/test/{parse.test.js → parse.js} +1 -2
  105. data/server/node_modules/express/node_modules/qs/test/{stringify.test.js → stringify.js} +0 -0
  106. data/server/node_modules/express/package.json +9 -8
  107. data/server/node_modules/express/testing/foo/app.js +35 -0
  108. data/server/node_modules/express/testing/foo/package.json +9 -0
  109. data/server/node_modules/express/testing/foo/public/stylesheets/style.css +8 -0
  110. data/server/node_modules/express/testing/foo/routes/index.js +10 -0
  111. data/server/node_modules/express/testing/foo/views/index.jade +2 -0
  112. data/server/node_modules/express/testing/foo/views/layout.jade +6 -0
  113. data/server/node_modules/express/testing/index.js +43 -0
  114. data/server/node_modules/express/testing/public/test.txt +2971 -0
  115. data/server/node_modules/express/testing/views/page.html +1 -0
  116. data/server/node_modules/express/testing/views/page.jade +3 -0
  117. data/server/node_modules/express/testing/views/test.md +1 -0
  118. data/server/node_modules/express/testing/views/user/index.jade +1 -0
  119. data/server/node_modules/express/testing/views/user/list.jade +1 -0
  120. data/server/node_modules/node-uuid/README.md +166 -67
  121. data/server/node_modules/node-uuid/benchmark/README.md +53 -0
  122. data/server/node_modules/node-uuid/benchmark/bench.gnu +174 -0
  123. data/server/node_modules/node-uuid/benchmark/bench.sh +34 -0
  124. data/server/node_modules/node-uuid/{test → benchmark}/benchmark-native.c +0 -0
  125. data/server/node_modules/node-uuid/benchmark/benchmark.js +84 -0
  126. data/server/node_modules/node-uuid/package.json +5 -3
  127. data/server/node_modules/node-uuid/test/benchmark-native +0 -0
  128. data/server/node_modules/node-uuid/test/compare_v1.js +63 -0
  129. data/server/node_modules/node-uuid/test/test.html +3 -0
  130. data/server/node_modules/node-uuid/test/test.js +214 -57
  131. data/server/node_modules/node-uuid/uuid.js +225 -56
  132. data/server/node_modules/restler/README.md +20 -7
  133. data/server/node_modules/restler/bin/restler +1 -1
  134. data/server/node_modules/restler/lib/multipartform.js +9 -8
  135. data/server/node_modules/restler/lib/restler.js +64 -22
  136. data/server/node_modules/restler/package.json +2 -2
  137. data/server/node_modules/restler/test/restler.js +22 -2
  138. data/server/node_modules/restler/test/test_helper.js +20 -1
  139. data/server/package.json +1 -2
  140. data/server/web.js +30 -7
  141. metadata +90 -86
  142. data/server/node_modules/cradle/node_modules/vows/LICENSE +0 -20
  143. data/server/node_modules/cradle/node_modules/vows/Makefile +0 -7
  144. data/server/node_modules/cradle/node_modules/vows/README.md +0 -39
  145. data/server/node_modules/cradle/node_modules/vows/bin/vows +0 -515
  146. data/server/node_modules/cradle/node_modules/vows/lib/assert/error.js +0 -27
  147. data/server/node_modules/cradle/node_modules/vows/lib/assert/macros.js +0 -215
  148. data/server/node_modules/cradle/node_modules/vows/lib/assert/utils.js +0 -77
  149. data/server/node_modules/cradle/node_modules/vows/lib/vows/console.js +0 -131
  150. data/server/node_modules/cradle/node_modules/vows/lib/vows/context.js +0 -55
  151. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/file.js +0 -29
  152. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html +0 -2
  153. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html +0 -61
  154. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-html.js +0 -54
  155. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-json.js +0 -54
  156. data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-plain.js +0 -38
  157. data/server/node_modules/cradle/node_modules/vows/lib/vows/extras.js +0 -28
  158. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/dot-matrix.js +0 -67
  159. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/json.js +0 -16
  160. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/silent.js +0 -8
  161. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/spec.js +0 -44
  162. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/watch.js +0 -39
  163. data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/xunit.js +0 -90
  164. data/server/node_modules/cradle/node_modules/vows/lib/vows/suite.js +0 -319
  165. data/server/node_modules/cradle/node_modules/vows/lib/vows.js +0 -193
  166. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/LICENSE +0 -20
  167. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/Makefile +0 -4
  168. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/README.md +0 -72
  169. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/lib/eyes.js +0 -233
  170. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/package.json +0 -14
  171. data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/test/eyes-test.js +0 -55
  172. data/server/node_modules/cradle/node_modules/vows/package.json +0 -14
  173. data/server/node_modules/cradle/node_modules/vows/test/assert-test.js +0 -135
  174. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/failing.js +0 -18
  175. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/log.js +0 -18
  176. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/passing.js +0 -17
  177. data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/stderr.js +0 -18
  178. data/server/node_modules/cradle/node_modules/vows/test/isolate-test.js +0 -140
  179. data/server/node_modules/cradle/node_modules/vows/test/testInherit.js +0 -133
  180. data/server/node_modules/cradle/node_modules/vows/test/vows-error-test.js +0 -51
  181. data/server/node_modules/cradle/node_modules/vows/test/vows-test.js +0 -374
  182. data/server/node_modules/express/node_modules/mime/index.js +0 -1
  183. data/server/node_modules/express/node_modules/qs/support/expresso/History.md +0 -128
  184. data/server/node_modules/express/node_modules/qs/support/expresso/Makefile +0 -53
  185. data/server/node_modules/express/node_modules/qs/support/expresso/Readme.md +0 -61
  186. data/server/node_modules/express/node_modules/qs/support/expresso/bin/expresso +0 -856
  187. data/server/node_modules/express/node_modules/qs/support/expresso/docs/api.html +0 -1080
  188. data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.html +0 -377
  189. data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.md +0 -290
  190. data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/foot.html +0 -3
  191. data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/head.html +0 -42
  192. data/server/node_modules/express/node_modules/qs/support/expresso/lib/bar.js +0 -4
  193. data/server/node_modules/express/node_modules/qs/support/expresso/lib/foo.js +0 -16
  194. data/server/node_modules/express/node_modules/qs/support/expresso/package.json +0 -12
  195. data/server/node_modules/express/node_modules/qs/support/expresso/test/assert.test.js +0 -91
  196. data/server/node_modules/express/node_modules/qs/support/expresso/test/async.test.js +0 -12
  197. data/server/node_modules/express/node_modules/qs/support/expresso/test/bar.test.js +0 -13
  198. data/server/node_modules/express/node_modules/qs/support/expresso/test/foo.test.js +0 -14
  199. data/server/node_modules/express/node_modules/qs/support/expresso/test/http.test.js +0 -146
  200. data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/async.test.js +0 -39
  201. data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/http.test.js +0 -48
  202. data/server/node_modules/express/node_modules/qs/support/should/History.md +0 -22
  203. data/server/node_modules/express/node_modules/qs/support/should/Makefile +0 -6
  204. data/server/node_modules/express/node_modules/qs/support/should/Readme.md +0 -248
  205. data/server/node_modules/express/node_modules/qs/support/should/examples/runner.js +0 -53
  206. data/server/node_modules/express/node_modules/qs/support/should/index.js +0 -2
  207. data/server/node_modules/express/node_modules/qs/support/should/lib/eql.js +0 -91
  208. data/server/node_modules/express/node_modules/qs/support/should/lib/should.js +0 -548
  209. data/server/node_modules/express/node_modules/qs/support/should/package.json +0 -8
  210. data/server/node_modules/express/node_modules/qs/support/should/test/should.test.js +0 -358
  211. data/server/node_modules/node-uuid/test/benchmark.js +0 -27
@@ -1,374 +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
- var api = vows.prepare({
8
- get: function (id, callback) {
9
- process.nextTick(function () { callback(null, id) });
10
- },
11
- version: function () { return '1.0' }
12
- }, ['get']);
13
-
14
- var promiser = function (val) {
15
- return function () {
16
- var promise = new(events.EventEmitter);
17
- process.nextTick(function () { promise.emit('success', val) });
18
- return promise;
19
- }
20
- };
21
-
22
- vows.describe("Vows").addBatch({
23
- "A context": {
24
- topic: promiser("hello world"),
25
-
26
- "with a nested context": {
27
- topic: function (parent) {
28
- this.state = 42;
29
- return promiser(parent)();
30
- },
31
- "has access to the environment": function () {
32
- assert.equal(this.state, 42);
33
- },
34
- "and a sub nested context": {
35
- topic: function () {
36
- return this.state;
37
- },
38
- "has access to the parent environment": function (r) {
39
- assert.equal(r, 42);
40
- assert.equal(this.state, 42);
41
- },
42
- "has access to the parent context object": function (r) {
43
- assert.ok(Array.isArray(this.context.topics));
44
- assert.include(this.context.topics, "hello world");
45
- }
46
- }
47
- }
48
- },
49
- "A nested context": {
50
- topic: promiser(1),
51
-
52
- ".": {
53
- topic: function (a) { return promiser(2)() },
54
-
55
- ".": {
56
- topic: function (b, a) { return promiser(3)() },
57
-
58
- ".": {
59
- topic: function (c, b, a) { return promiser([4, c, b, a])() },
60
-
61
- "should have access to the parent topics": function (topics) {
62
- assert.equal(topics.join(), [4, 3, 2, 1].join());
63
- }
64
- },
65
-
66
- "from": {
67
- topic: function (c, b, a) { return promiser([4, c, b, a])() },
68
-
69
- "the parent topics": function(topics) {
70
- assert.equal(topics.join(), [4, 3, 2, 1].join());
71
- }
72
- }
73
- }
74
- }
75
- },
76
- "Nested contexts with callback-style async": {
77
- topic: function () {
78
- fs.stat(__dirname + '/vows-test.js', this.callback);
79
- },
80
- 'after a successful `fs.stat`': {
81
- topic: function (stat) {
82
- fs.open(__dirname + '/vows-test.js', "r", stat.mode, this.callback);
83
- },
84
- 'after a successful `fs.open`': {
85
- topic: function (fd, stat) {
86
- fs.read(fd, stat.size, 0, "utf8", this.callback);
87
- },
88
- 'after a successful `fs.read`': function (data) {
89
- assert.match (data, /after a successful `fs.read`/);
90
- }
91
- }
92
- }
93
- },
94
- "A nested context with no topics": {
95
- topic: 45,
96
- ".": {
97
- ".": {
98
- "should pass the value down": function (topic) {
99
- assert.equal(topic, 45);
100
- }
101
- }
102
- }
103
- },
104
- "A Nested context with topic gaps": {
105
- topic: 45,
106
- ".": {
107
- ".": {
108
- topic: 101,
109
- ".": {
110
- ".": {
111
- topic: function (prev, prev2) {
112
- return this.context.topics.slice(0);
113
- },
114
- "should pass the topics down": function (topics) {
115
- assert.length(topics, 2);
116
- assert.equal(topics[0], 101);
117
- assert.equal(topics[1], 45);
118
- }
119
- }
120
- }
121
- }
122
- }
123
- },
124
- "A non-promise return value": {
125
- topic: function () { return 1 },
126
- "should be converted to a promise": function (val) {
127
- assert.equal(val, 1);
128
- }
129
- },
130
- "A 'prepared' interface": {
131
- "with a wrapped function": {
132
- topic: function () { return api.get(42) },
133
- "should work as expected": function (val) {
134
- assert.equal(val, 42);
135
- }
136
- },
137
- "with a non-wrapped function": {
138
- topic: function () { return api.version() },
139
- "should work as expected": function (val) {
140
- assert.equal(val, '1.0');
141
- }
142
- }
143
- },
144
- "A non-function topic": {
145
- topic: 45,
146
-
147
- "should work as expected": function (topic) {
148
- assert.equal(topic, 45);
149
- }
150
- },
151
- "A non-function topic with a falsy value": {
152
- topic: 0,
153
-
154
- "should work as expected": function (topic) {
155
- assert.equal(topic, 0);
156
- }
157
- },
158
- "A topic returning a function": {
159
- topic: function () {
160
- return function () { return 42 };
161
- },
162
-
163
- "should work as expected": function (topic) {
164
- assert.isFunction(topic);
165
- assert.equal(topic(), 42);
166
- },
167
- "in a sub-context": {
168
- "should work as expected": function (topic) {
169
- assert.isFunction(topic);
170
- assert.equal(topic(), 42);
171
- },
172
- }
173
- },
174
- "A topic emitting an error": {
175
- topic: function () {
176
- var promise = new(events.EventEmitter);
177
- process.nextTick(function () {
178
- promise.emit("error", 404);
179
- });
180
- return promise;
181
- },
182
- "shouldn't raise an exception if the test expects it": function (e, res) {
183
- assert.equal(e, 404);
184
- assert.ok(! res);
185
- }
186
- },
187
- "A topic not emitting an error": {
188
- topic: function () {
189
- var promise = new(events.EventEmitter);
190
- process.nextTick(function () {
191
- promise.emit("success", true);
192
- });
193
- return promise;
194
- },
195
- "should pass `null` as first argument, if the test is expecting an error": function (e, res) {
196
- assert.strictEqual(e, null);
197
- assert.equal(res, true);
198
- },
199
- "should pass the result as first argument if the test isn't expecting an error": function (res) {
200
- assert.equal(res, true);
201
- }
202
- },
203
- "A topic with callback-style async": {
204
- "when successful": {
205
- topic: function () {
206
- var that = this;
207
- process.nextTick(function () {
208
- that.callback(null, "OK");
209
- });
210
- },
211
- "should work like an event-emitter": function (res) {
212
- assert.equal(res, "OK");
213
- },
214
- "should assign `null` to the error argument": function (e, res) {
215
- assert.strictEqual(e, null);
216
- assert.equal(res, "OK");
217
- }
218
- },
219
- "when unsuccessful": {
220
- topic: function () {
221
- function async(callback) {
222
- process.nextTick(function () {
223
- callback("ERROR");
224
- });
225
- }
226
- async(this.callback);
227
- },
228
- "should have a non-null error value": function (e, res) {
229
- assert.equal(e, "ERROR");
230
- },
231
- "should work like an event-emitter": function (e, res) {
232
- assert.equal(res, undefined);
233
- }
234
- },
235
- "using this.callback synchronously": {
236
- topic: function () {
237
- this.callback(null, 'hello');
238
- },
239
- "should work the same as returning a value": function (res) {
240
- assert.equal(res, 'hello');
241
- }
242
- },
243
- "using this.callback with a user context": {
244
- topic: function () {
245
- this.callback.call({ boo: true }, null, 'hello');
246
- },
247
- "should give access to the user context": function (res) {
248
- assert.isTrue(this.boo);
249
- }
250
- },
251
- "passing this.callback to a function": {
252
- topic: function () {
253
- this.boo = true;
254
- var async = function (callback) {
255
- callback(null);
256
- };
257
- async(this.callback);
258
- },
259
- "should give access to the topic context": function () {
260
- assert.isTrue(this.boo);
261
- }
262
- },
263
- "with multiple arguments": {
264
- topic: function () {
265
- this.callback(null, 1, 2, 3);
266
- },
267
- "should pass them to the vow": function (e, a, b, c) {
268
- assert.strictEqual(e, null);
269
- assert.strictEqual(a, 1);
270
- assert.strictEqual(b, 2);
271
- assert.strictEqual(c, 3);
272
- },
273
- "and a sub-topic": {
274
- topic: function (a, b, c) {
275
- return [a, b, c];
276
- },
277
- "should receive them too": function (val) {
278
- assert.deepEqual(val, [1, 2, 3]);
279
- }
280
- }
281
- }
282
- }
283
- }).addBatch({
284
- "A Sibling context": {
285
- "'A', with `this.foo = true`": {
286
- topic: function () {
287
- this.foo = true;
288
- return this;
289
- },
290
- "should have `this.foo` set to true": function (res) {
291
- assert.equal(res.foo, true);
292
- }
293
- },
294
- "'B', with nothing set": {
295
- topic: function () {
296
- return this;
297
- },
298
- "shouldn't have access to `this.foo`": function (e, res) {
299
- assert.isUndefined(res.foo);
300
- }
301
- }
302
- }
303
- }).addBatch({
304
- "A 2nd batch": {
305
- topic: function () {
306
- var p = new(events.EventEmitter);
307
- setTimeout(function () {
308
- p.emit("success");
309
- }, 100);
310
- return p;
311
- },
312
- "should run after the first": function () {}
313
- }
314
- }).addBatch({
315
- "A 3rd batch": {
316
- topic: true, "should run last": function () {}
317
- }
318
- }).addBatch({}).export(module);
319
-
320
- vows.describe("Vows with a single batch", {
321
- "This is a batch that's added as the optional parameter to describe()": {
322
- topic: true,
323
- "And a vow": function () {}
324
- }
325
- }).export(module);
326
-
327
- vows.describe("Vows with multiple batches added as optional parameters", {
328
- "First batch": {
329
- topic: true,
330
- "should be run first": function () {}
331
- }
332
- }, {
333
- "Second batch": {
334
- topic: true,
335
- "should be run second": function () {}
336
- }
337
- }).export(module);
338
-
339
- vows.describe("Vows with teardowns").addBatch({
340
- "A context": {
341
- topic: function () {
342
- return { flag: true };
343
- },
344
- "And a vow": function (topic) {
345
- assert.isTrue(topic.flag);
346
- },
347
- "And another vow": function (topic) {
348
- assert.isTrue(topic.flag);
349
- },
350
- "And a final vow": function (topic) {
351
- assert.isTrue(topic.flag);
352
- },
353
- 'subcontext': {
354
- 'nested': function (_, topic) {
355
- assert.isTrue(topic.flag);
356
- }
357
- },
358
- teardown: function (topic) {
359
- topic.flag = false;
360
- },
361
- "with a subcontext" : {
362
- topic: function (topic) {
363
- var that = this;
364
- process.nextTick(function () {
365
- that.callback(null, topic);
366
- });
367
- },
368
- "Waits for the subcontext before teardown" : function(topic) {
369
- assert.isTrue(topic.flag);
370
- }
371
- }
372
- }
373
- }).export(module);
374
-
@@ -1 +0,0 @@
1
- module.exports = require('./mime');
@@ -1,128 +0,0 @@
1
-
2
- 0.7.2 / 2010-12-29
3
- ==================
4
-
5
- * Fixed problem with `listen()` sometimes firing on the same tick [guillermo]
6
-
7
- 0.7.1 / 2010-12-28
8
- ==================
9
-
10
- * Fixed `assert.request()` client logic into an issue() function, fired upon the `listen()` callback if the server doesn't have an assigned fd. [guillermo]
11
- * Removed `--watch`
12
-
13
- 0.7.0 / 2010-11-19
14
- ==================
15
-
16
- * Removed `assert` from test function signature
17
- Just use `require('assert')` :) this will make integration
18
- with libraries like [should](http://github.com/visionmedia/should) cleaner.
19
-
20
- 0.6.4 / 2010-11-02
21
- ==================
22
-
23
- * Added regexp support to `assert.response()` headers
24
- * Removed `waitForExit` code, causing issues
25
-
26
- 0.6.3 / 2010-11-02
27
- ==================
28
-
29
- * Added `assert.response()` body RegExp support
30
- * Fixed issue with _--serial_ not executing files sequentially. Closes #42
31
- * Fixed hang when modules use `setInterval` - monitor running tests & force the process to quit after all have completed + timeout [Steve Mason]
32
-
33
- 0.6.2 / 2010-09-17
34
- ==================
35
-
36
- * Added _node-jsocoverage_ to package.json (aka will respect npm's binroot)
37
- * Added _-t, --timeout_ MS option, defaulting to 2000 ms
38
- * Added _-s, --serial_
39
- * __PREFIX__ clobberable
40
- * Fixed `assert.response()` for latest node
41
- * Fixed cov reporting from exploding on empty files
42
-
43
- 0.6.2 / 2010-08-03
44
- ==================
45
-
46
- * Added `assert.type()`
47
- * Renamed `assert.isNotUndefined()` to `assert.isDefined()`
48
- * Fixed `assert.includes()` param ordering
49
-
50
- 0.6.0 / 2010-07-31
51
- ==================
52
-
53
- * Added _docs/api.html_
54
- * Added -w, --watch
55
- * Added `Array` support to `assert.includes()`
56
- * Added; outputting exceptions immediately. Closes #19
57
- * Fixed `assert.includes()` param ordering
58
- * Fixed `assert.length()` param ordering
59
- * Fixed jscoverage links
60
-
61
- 0.5.0 / 2010-07-16
62
- ==================
63
-
64
- * Added support for async exports
65
- * Added timeout support to `assert.response()`. Closes #3
66
- * Added 4th arg callback support to `assert.response()`
67
- * Added `assert.length()`
68
- * Added `assert.match()`
69
- * Added `assert.isUndefined()`
70
- * Added `assert.isNull()`
71
- * Added `assert.includes()`
72
- * Added growlnotify support via -g, --growl
73
- * Added -o, --only TESTS. Ex: --only "test foo()" --only "test foo(), test bar()"
74
- * Removed profanity
75
-
76
- 0.4.0 / 2010-07-09
77
- ==================
78
-
79
- * Added reporting source coverage (respects --boring for color haters)
80
- * Added callback to assert.response(). Closes #12
81
- * Fixed; putting exceptions to stderr. Closes #13
82
-
83
- 0.3.1 / 2010-06-28
84
- ==================
85
-
86
- * Faster assert.response()
87
-
88
- 0.3.0 / 2010-06-28
89
- ==================
90
-
91
- * Added -p, --port NUM flags
92
- * Added assert.response(). Closes #11
93
-
94
- 0.2.1 / 2010-06-25
95
- ==================
96
-
97
- * Fixed issue with reporting object assertions
98
-
99
- 0.2.0 / 2010-06-21
100
- ==================
101
-
102
- * Added `make uninstall`
103
- * Added better readdir() failure message
104
- * Fixed `make install` for kiwi
105
-
106
- 0.1.0 / 2010-06-15
107
- ==================
108
-
109
- * Added better usage docs via --help
110
- * Added better conditional color support
111
- * Added pre exit assertion support
112
-
113
- 0.0.3 / 2010-06-02
114
- ==================
115
-
116
- * Added more room for filenames in test coverage
117
- * Added boring output support via --boring (suppress colored output)
118
- * Fixed async failure exit status
119
-
120
- 0.0.2 / 2010-05-30
121
- ==================
122
-
123
- * Fixed exit status for CI support
124
-
125
- 0.0.1 / 2010-05-30
126
- ==================
127
-
128
- * Initial release
@@ -1,53 +0,0 @@
1
-
2
- PREFIX ?= /usr/local
3
- BIN = bin/expresso
4
- JSCOV = deps/jscoverage/node-jscoverage
5
- DOCS = docs/index.md
6
- HTMLDOCS = $(DOCS:.md=.html)
7
-
8
- test: $(BIN)
9
- @./$(BIN) -I lib --growl $(TEST_FLAGS) test/*.test.js
10
-
11
- test-cov:
12
- @./$(BIN) -I lib --cov $(TEST_FLAGS) test/*.test.js
13
-
14
- test-serial:
15
- @./$(BIN) --serial -I lib $(TEST_FLAGS) test/serial/*.test.js
16
-
17
- install: install-jscov install-expresso
18
-
19
- uninstall:
20
- rm -f $(PREFIX)/bin/expresso
21
- rm -f $(PREFIX)/bin/node-jscoverage
22
-
23
- install-jscov: $(JSCOV)
24
- install $(JSCOV) $(PREFIX)/bin
25
-
26
- install-expresso:
27
- install $(BIN) $(PREFIX)/bin
28
-
29
- $(JSCOV):
30
- cd deps/jscoverage && ./configure && make && mv jscoverage node-jscoverage
31
-
32
- clean:
33
- @cd deps/jscoverage && git clean -fd
34
-
35
- docs: docs/api.html $(HTMLDOCS)
36
-
37
- %.html: %.md
38
- @echo "... $< > $@"
39
- @ronn -5 --pipe --fragment $< \
40
- | cat docs/layout/head.html - docs/layout/foot.html \
41
- > $@
42
-
43
- docs/api.html: bin/expresso
44
- dox \
45
- --title "Expresso" \
46
- --ribbon "http://github.com/visionmedia/expresso" \
47
- --desc "Insanely fast TDD framework for [node](http://nodejs.org) featuring code coverage reporting." \
48
- $< > $@
49
-
50
- docclean:
51
- rm -f docs/*.html
52
-
53
- .PHONY: test test-cov install uninstall install-expresso install-jscov clean docs docclean
@@ -1,61 +0,0 @@
1
-
2
- # Expresso
3
-
4
- TDD framework for [nodejs](http://nodejs.org).
5
-
6
- ## Features
7
-
8
- - light-weight
9
- - intuitive async support
10
- - intuitive test runner executable
11
- - test coverage support and reporting
12
- - uses the _assert_ module
13
- - `assert.eql()` alias of `assert.deepEqual()`
14
- - `assert.response()` http response utility
15
- - `assert.includes()`
16
- - `assert.type()`
17
- - `assert.isNull()`
18
- - `assert.isUndefined()`
19
- - `assert.isNotNull()`
20
- - `assert.isDefined()`
21
- - `assert.match()`
22
- - `assert.length()`
23
-
24
- ## Installation
25
-
26
- To install both expresso _and_ node-jscoverage run:
27
-
28
- $ make install
29
-
30
- To install expresso alone (no build required) run:
31
-
32
- $ make install-expresso
33
-
34
- Install via npm:
35
-
36
- $ npm install expresso
37
-
38
- ## License
39
-
40
- (The MIT License)
41
-
42
- Copyright (c) 2010 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
43
-
44
- Permission is hereby granted, free of charge, to any person obtaining
45
- a copy of this software and associated documentation files (the
46
- 'Software'), to deal in the Software without restriction, including
47
- without limitation the rights to use, copy, modify, merge, publish,
48
- distribute, sublicense, and/or sell copies of the Software, and to
49
- permit persons to whom the Software is furnished to do so, subject to
50
- the following conditions:
51
-
52
- The above copyright notice and this permission notice shall be
53
- included in all copies or substantial portions of the Software.
54
-
55
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
56
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
57
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
58
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
59
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
60
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
61
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.