Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added npm stuff, and minor refactoring

  • Loading branch information...
commit 6c67eda70108fe491ed0c900d3b0fa2b640a128e 1 parent 2b57585
@davemckenna01 authored
Showing with 37,407 additions and 5 deletions.
  1. +2 −0  .npmignore
  2. +1 −1  Readme.md
  3. +6 −4 lib/shync.js
  4. +1 −0  node_modules/.bin/_mocha
  5. +1 −0  node_modules/.bin/mocha
  6. +3 −0  node_modules/chai/.npmignore
  7. +7 −0 node_modules/chai/.travis.yml
  8. +338 −0 node_modules/chai/History.md
  9. +45 −0 node_modules/chai/Makefile
  10. +97 −0 node_modules/chai/README.md
  11. +2,223 −0 node_modules/chai/chai.js
  12. +333 −0 node_modules/chai/coverage.html
  13. +3 −0  node_modules/chai/index.js
  14. +581 −0 node_modules/chai/lib-cov/assertion.js
  15. +59 −0 node_modules/chai/lib-cov/chai.js
  16. +54 −0 node_modules/chai/lib-cov/error.js
  17. +281 −0 node_modules/chai/lib-cov/interface/assert.js
  18. +17 −0 node_modules/chai/lib-cov/interface/expect.js
  19. +92 −0 node_modules/chai/lib-cov/interface/should.js
  20. +182 −0 node_modules/chai/lib-cov/utils/eql.js
  21. +453 −0 node_modules/chai/lib-cov/utils/inspect.js
  22. +1,015 −0 node_modules/chai/lib/assertion.js
  23. +33 −0 node_modules/chai/lib/chai.js
  24. +33 −0 node_modules/chai/lib/error.js
  25. +619 −0 node_modules/chai/lib/interface/assert.js
  26. +12 −0 node_modules/chai/lib/interface/expect.js
  27. +56 −0 node_modules/chai/lib/interface/should.js
  28. +100 −0 node_modules/chai/lib/utils/eql.js
  29. +270 −0 node_modules/chai/lib/utils/inspect.js
  30. +45 −0 node_modules/chai/package.json
  31. +112 −0 node_modules/chai/support/compile.js
  32. +4 −0 node_modules/chai/support/prefix.js
  33. +3 −0  node_modules/chai/support/suffix.js
  34. +331 −0 node_modules/chai/test/assert.js
  35. +23 −0 node_modules/chai/test/browser/docs.html
  36. +23 −0 node_modules/chai/test/browser/index.html
  37. +35 −0 node_modules/chai/test/configuration.js
  38. +526 −0 node_modules/chai/test/expect.js
  39. +26 −0 node_modules/chai/test/plugins.js
  40. +532 −0 node_modules/chai/test/should.js
  41. +5 −0 node_modules/mocha/.npmignore
  42. +5 −0 node_modules/mocha/.travis.yml
  43. +310 −0 node_modules/mocha/History.md
  44. +22 −0 node_modules/mocha/LICENSE
  45. +118 −0 node_modules/mocha/Makefile
  46. +34 −0 node_modules/mocha/Readme.md
  47. +3,916 −0 node_modules/mocha/_mocha.js
  48. +345 −0 node_modules/mocha/bin/_mocha
  49. +32 −0 node_modules/mocha/bin/mocha
  50. +334 −0 node_modules/mocha/coverage.html
  51. +16 −0 node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet
  52. +16 −0 node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet
  53. +16 −0 node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet
  54. +16 −0 node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet
  55. +16 −0 node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet
  56. +16 −0 node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/untitled.tmSnippet
  57. +19 −0 node_modules/mocha/editors/JavaScript mocha.tmbundle/info.plist
  58. BIN  node_modules/mocha/images/error.png
  59. BIN  node_modules/mocha/images/ok.png
  60. +4 −0 node_modules/mocha/index.js
  61. +6 −0 node_modules/mocha/lib/browser/debug.js
  62. 0  node_modules/mocha/lib/browser/diff.js
  63. +178 −0 node_modules/mocha/lib/browser/events.js
  64. 0  node_modules/mocha/lib/browser/fs.js
  65. 0  node_modules/mocha/lib/browser/path.js
  66. +125 −0 node_modules/mocha/lib/browser/progress.js
  67. +8 −0 node_modules/mocha/lib/browser/tty.js
  68. +55 −0 node_modules/mocha/lib/context.js
  69. +31 −0 node_modules/mocha/lib/hook.js
  70. +91 −0 node_modules/mocha/lib/interfaces/bdd.js
  71. +60 −0 node_modules/mocha/lib/interfaces/exports.js
  72. +5 −0 node_modules/mocha/lib/interfaces/index.js
  73. +91 −0 node_modules/mocha/lib/interfaces/qunit.js
  74. +94 −0 node_modules/mocha/lib/interfaces/tdd.js
  75. +176 −0 node_modules/mocha/lib/mocha.js
  76. +319 −0 node_modules/mocha/lib/reporters/base.js
  77. +74 −0 node_modules/mocha/lib/reporters/doc.js
  78. +62 −0 node_modules/mocha/lib/reporters/dot.js
  79. +44 −0 node_modules/mocha/lib/reporters/html-cov.js
  80. +211 −0 node_modules/mocha/lib/reporters/html.js
  81. +17 −0 node_modules/mocha/lib/reporters/index.js
  82. +149 −0 node_modules/mocha/lib/reporters/json-cov.js
  83. +61 −0 node_modules/mocha/lib/reporters/json-stream.js
  84. +70 −0 node_modules/mocha/lib/reporters/json.js
  85. +97 −0 node_modules/mocha/lib/reporters/landing.js
  86. +64 −0 node_modules/mocha/lib/reporters/list.js
  87. +111 −0 node_modules/mocha/lib/reporters/markdown.js
  88. +37 −0 node_modules/mocha/lib/reporters/min.js
  89. +85 −0 node_modules/mocha/lib/reporters/progress.js
  90. +87 −0 node_modules/mocha/lib/reporters/spec.js
  91. +63 −0 node_modules/mocha/lib/reporters/tap.js
  92. +56 −0 node_modules/mocha/lib/reporters/teamcity.js
  93. +50 −0 node_modules/mocha/lib/reporters/templates/coverage.jade
  94. +13 −0 node_modules/mocha/lib/reporters/templates/menu.jade
  95. +34 −0 node_modules/mocha/lib/reporters/templates/script.html
  96. +301 −0 node_modules/mocha/lib/reporters/templates/style.html
  97. +101 −0 node_modules/mocha/lib/reporters/xunit.js
  98. +162 −0 node_modules/mocha/lib/runnable.js
  99. +433 −0 node_modules/mocha/lib/runner.js
  100. +247 −0 node_modules/mocha/lib/suite.js
  101. +49 −0 node_modules/mocha/lib/test.js
  102. +189 −0 node_modules/mocha/lib/utils.js
  103. +137 −0 node_modules/mocha/mocha.css
  104. +4,068 −0 node_modules/mocha/mocha.js
  105. +1 −0  node_modules/mocha/node_modules/.bin/jade
  106. +4 −0 node_modules/mocha/node_modules/commander/.npmignore
  107. +4 −0 node_modules/mocha/node_modules/commander/.travis.yml
  108. +99 −0 node_modules/mocha/node_modules/commander/History.md
  109. +7 −0 node_modules/mocha/node_modules/commander/Makefile
  110. +263 −0 node_modules/mocha/node_modules/commander/Readme.md
  111. +2 −0  node_modules/mocha/node_modules/commander/index.js
  112. +992 −0 node_modules/mocha/node_modules/commander/lib/commander.js
  113. +42 −0 node_modules/mocha/node_modules/commander/package.json
  114. +4 −0 node_modules/mocha/node_modules/debug/.npmignore
  115. +41 −0 node_modules/mocha/node_modules/debug/History.md
  116. +5 −0 node_modules/mocha/node_modules/debug/Makefile
  117. +130 −0 node_modules/mocha/node_modules/debug/Readme.md
  118. +122 −0 node_modules/mocha/node_modules/debug/debug.js
  119. +19 −0 node_modules/mocha/node_modules/debug/example/app.js
  120. +24 −0 node_modules/mocha/node_modules/debug/example/browser.html
  121. +10 −0 node_modules/mocha/node_modules/debug/example/wildcards.js
  122. +22 −0 node_modules/mocha/node_modules/debug/example/worker.js
  123. +2 −0  node_modules/mocha/node_modules/debug/index.js
  124. +147 −0 node_modules/mocha/node_modules/debug/lib/debug.js
  125. +33 −0 node_modules/mocha/node_modules/debug/package.json
  126. +31 −0 node_modules/mocha/node_modules/diff/LICENSE
  127. +94 −0 node_modules/mocha/node_modules/diff/README.md
  128. +287 −0 node_modules/mocha/node_modules/diff/diff.js
  129. +89 −0 node_modules/mocha/node_modules/diff/index.html
  130. +50 −0 node_modules/mocha/node_modules/diff/package.json
  131. +81 −0 node_modules/mocha/node_modules/diff/style.css
  132. +616 −0 node_modules/mocha/node_modules/diff/test/diffTest.js
  133. +42 −0 node_modules/mocha/node_modules/growl/History.md
  134. +93 −0 node_modules/mocha/node_modules/growl/Readme.md
  135. +188 −0 node_modules/mocha/node_modules/growl/lib/growl.js
  136. +26 −0 node_modules/mocha/node_modules/growl/package.json
  137. +16 −0 node_modules/mocha/node_modules/growl/test.js
  138. +4 −0 node_modules/mocha/node_modules/jade/.npmignore
  139. +22 −0 node_modules/mocha/node_modules/jade/LICENSE
  140. +125 −0 node_modules/mocha/node_modules/jade/bin/jade
  141. +2 −0  node_modules/mocha/node_modules/jade/index.js
  142. +3,140 −0 node_modules/mocha/node_modules/jade/jade.js
  143. +2 −0  node_modules/mocha/node_modules/jade/jade.min.js
  144. +503 −0 node_modules/mocha/node_modules/jade/lib/compiler.js
  145. +18 −0 node_modules/mocha/node_modules/jade/lib/doctypes.js
  146. +97 −0 node_modules/mocha/node_modules/jade/lib/filters.js
  147. +1 −0  node_modules/mocha/node_modules/jade/lib/index.js
  148. +28 −0 node_modules/mocha/node_modules/jade/lib/inline-tags.js
  149. +237 −0 node_modules/mocha/node_modules/jade/lib/jade.js
  150. +707 −0 node_modules/mocha/node_modules/jade/lib/lexer.js
  151. +33 −0 node_modules/mocha/node_modules/jade/lib/nodes/block-comment.js
  152. +100 −0 node_modules/mocha/node_modules/jade/lib/nodes/block.js
  153. +43 −0 node_modules/mocha/node_modules/jade/lib/nodes/case.js
  154. +35 −0 node_modules/mocha/node_modules/jade/lib/nodes/code.js
  155. +32 −0 node_modules/mocha/node_modules/jade/lib/nodes/comment.js
  156. +29 −0 node_modules/mocha/node_modules/jade/lib/nodes/doctype.js
  157. +35 −0 node_modules/mocha/node_modules/jade/lib/nodes/each.js
  158. +35 −0 node_modules/mocha/node_modules/jade/lib/nodes/filter.js
  159. +20 −0 node_modules/mocha/node_modules/jade/lib/nodes/index.js
  160. +31 −0 node_modules/mocha/node_modules/jade/lib/nodes/literal.js
  161. +34 −0 node_modules/mocha/node_modules/jade/lib/nodes/mixin.js
  162. +14 −0 node_modules/mocha/node_modules/jade/lib/nodes/node.js
  163. +80 −0 node_modules/mocha/node_modules/jade/lib/nodes/tag.js
  164. +42 −0 node_modules/mocha/node_modules/jade/lib/nodes/text.js
  165. +651 −0 node_modules/mocha/node_modules/jade/lib/parser.js
  166. +118 −0 node_modules/mocha/node_modules/jade/lib/runtime.js
  167. +18 −0 node_modules/mocha/node_modules/jade/lib/self-closing.js
  168. +49 −0 node_modules/mocha/node_modules/jade/lib/utils.js
  169. +2 −0  node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.orig
  170. +5 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.rej
  171. +2 −0  node_modules/mocha/node_modules/jade/node_modules/mkdirp/.npmignore
  172. +21 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/LICENSE
  173. +54 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/README.markdown
  174. +6 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js
  175. +6 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig
  176. +19 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej
  177. +79 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/index.js
  178. +41 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/package.json
  179. +38 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/chmod.js
  180. +37 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/clobber.js
  181. +28 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/mkdirp.js
  182. +32 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm.js
  183. +39 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm_sync.js
  184. +41 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/race.js
  185. +32 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/rel.js
  186. +27 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/sync.js
  187. +28 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask.js
  188. +27 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask_sync.js
  189. +46 −0 node_modules/mocha/node_modules/jade/package.json
  190. +123 −0 node_modules/mocha/node_modules/jade/runtime.js
  191. +1 −0  node_modules/mocha/node_modules/jade/runtime.min.js
  192. +52 −0 node_modules/mocha/package.json
  193. +2 −0  node_modules/sinon/.npmignore
  194. +24 −0 node_modules/sinon/AUTHORS
  195. +236 −0 node_modules/sinon/Changelog.txt
  196. BIN  node_modules/sinon/GPATH
  197. BIN  node_modules/sinon/GRTAGS
  198. BIN  node_modules/sinon/GSYMS
  199. BIN  node_modules/sinon/GTAGS
  200. +27 −0 node_modules/sinon/LICENSE
  201. +10 −0 node_modules/sinon/Makefile
  202. +42 −0 node_modules/sinon/README.md
  203. +92 −0 node_modules/sinon/build
  204. +25 −0 node_modules/sinon/jsTestDriver.conf
  205. +10 −0 node_modules/sinon/jsTestDriverBuild.conf
  206. +54 −0 node_modules/sinon/jsl.conf
  207. +313 −0 node_modules/sinon/lib/sinon.js
  208. +171 −0 node_modules/sinon/lib/sinon/assert.js
  209. +141 −0 node_modules/sinon/lib/sinon/collection.js
  210. +407 −0 node_modules/sinon/lib/sinon/mock.js
  211. +125 −0 node_modules/sinon/lib/sinon/sandbox.js
  212. +488 −0 node_modules/sinon/lib/sinon/spy.js
  213. +277 −0 node_modules/sinon/lib/sinon/stub.js
  214. +67 −0 node_modules/sinon/lib/sinon/test.js
  215. +97 −0 node_modules/sinon/lib/sinon/test_case.js
  216. +74 −0 node_modules/sinon/lib/sinon/util/event.js
  217. +201 −0 node_modules/sinon/lib/sinon/util/fake_server.js
  218. +83 −0 node_modules/sinon/lib/sinon/util/fake_server_with_clock.js
  219. +339 −0 node_modules/sinon/lib/sinon/util/fake_timers.js
  220. +471 −0 node_modules/sinon/lib/sinon/util/fake_xml_http_request.js
  221. +27 −0 node_modules/sinon/lib/sinon/util/timers_ie.js
  222. +19 −0 node_modules/sinon/lib/sinon/util/xhr_ie.js
  223. +115 −0 node_modules/sinon/package.json
  224. +49 −0 node_modules/sinon/step-tests
  225. +595 −0 node_modules/sinon/test/Asserts.js
  226. +27 −0 node_modules/sinon/test/helper.js
  227. +13 −0 node_modules/sinon/test/node/run.js
  228. +1 −0  node_modules/sinon/test/resources/xhr_target.txt
Sorry, we could not display the entire diff because it was too big.
View
2  .npmignore
@@ -0,0 +1,2 @@
+Readme.md
+node_modules/
View
2  Readme.md
@@ -1,6 +1,6 @@
# shync
-shync is a simple, parallel cluster management tool for node. Specify an ssh or scp command and it will run on all servers in the cluster in parallel.
+Simple parallel server cluster management tool for node using ssh and scp. Specify an ssh or scp command and it will run on all servers in the cluster in parallel.
## ssh
View
10 lib/shync.js
@@ -2,9 +2,11 @@ var spawn = require('child_process').spawn;
function Shync(opts){
if (typeof opts !== 'object'
- || (opts.domains.length === 0 || !opts.user || !opts.keyLoc)){
+ || Object.prototype.toString.call(opts.domains) !== '[object Array]'
+ ||opts.domains.length === 0
+ || !opts.user || !opts.keyLoc){
throw {name: 'Error',
- message: 'You must pass a config object'}
+ message: 'You must pass a valid config object'}
}
this.opts = opts;
@@ -13,7 +15,7 @@ function Shync(opts){
this.procs = {};
}
-Shync.prototype.spawn = spawn;
+Shync.prototype._spawn = spawn;
function run(){
@@ -110,7 +112,7 @@ function _runCmd(opts, cmd){
cmdParams.push(opts.user+'@'+opts.domain+':'+cmd[1]);
}
- this.procs[opts.domain] = this.spawn(program, cmdParams);
+ this.procs[opts.domain] = this._spawn(program, cmdParams);
var self = this;
this.procs[opts.domain].addListener('exit', function(code){
View
1  node_modules/.bin/_mocha
View
1  node_modules/.bin/mocha
View
3  node_modules/chai/.npmignore
@@ -0,0 +1,3 @@
+.DS_Store
+.git*
+docs/
View
7 node_modules/chai/.travis.yml
@@ -0,0 +1,7 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
+branches:
+ only:
+ - master
View
338 node_modules/chai/History.md
@@ -0,0 +1,338 @@
+
+0.5.2 / 2012-03-21
+==================
+
+ * browser build
+ * Merge branch 'feature/assert-fail'
+ * Added assert.fail. Closes #40
+ * Merge branch 'bug/operator-msg'
+ * better error message for assert.operator. Closes #39
+ * version notes
+
+0.5.1 / 2012-03-14
+==================
+
+ * chai.fail no longer exists
+ * Merge branch 'feature/assertdefined'
+ * Added asset#isDefined. Closes #37.
+ * dev docs update for Assertion#assert
+
+0.5.0 / 2012-03-07
+==================
+
+ * [bug] on inspect of reg on n 0.4.12
+ * Merge branch 'bug/33-throws'
+ * Merge pull request #35 from logicalparadox/empty-object
+ * browser build
+ * updated #throw docs
+ * Assertion#throw `should` tests updated
+ * Assertion#throw `expect` tests
+ * Should interface supports multiple throw parameters
+ * Update Assertion#throw to support strings and type checks.
+ * Add more tests for `empty` in `should`.
+ * Add more tests for `empty` in `expect`.
+ * Merge branch 'master' into empty-object
+ * don't switch act/exp
+ * Merge pull request #34 from logicalparadox/assert-operator
+ * Update the compiled verison.
+ * Add `assert.operator`.
+ * Notes on messages. #22
+ * browser build
+ * have been test
+ * below tests
+ * Merge branch 'feature/actexp'
+ * browser build
+ * remove unnecessary fail export
+ * full support for actual/expected where relevant
+ * Assertion.assert support expected value
+ * clean up error
+ * Update the compiled version.
+ * Add object & sane arguments support to `Assertion#empty`.
+
+0.4.2 / 2012-02-28
+==================
+
+ * fix for `process` not available in browser when used via browserify. Closes #28
+ * Merge pull request #31 from joliss/doc
+ * Document that "should" works in browsers other than IE
+ * Merge pull request #30 from logicalparadox/assert-tests
+ * Update the browser version of chai.
+ * Update `assert.doesNotThrow` test in order to check the use case when type is a string.
+ * Add test for `assert.ifError`.
+ * Falsey -> falsy.
+ * Full coverage for `assert.throws` and `assert.doesNotThrow`.
+ * Add test for `assert.doesNotThrow`.
+ * Add test for `assert.throws`.
+ * Add test for `assert.length`.
+ * Add test for `assert.include`.
+ * Add test for `assert.isBoolean`.
+ * Fix the implementation of `assert.isNumber`.
+ * Add test for `assert.isNumber`.
+ * Add test for `assert.isString`.
+ * Add test for `assert.isArray`.
+ * Add test for `assert.isUndefined`.
+ * Add test for `assert.isNotNull`.
+ * Fix `assert.isNotNull` implementation.
+ * Fix `assert.isNull` implementation.
+ * Add test for `assert.isNull`.
+ * Add test for `assert.notDeepEqual`.
+ * Add test for `assert.deepEqual`.
+ * Add test for `assert.notStrictEqual`.
+ * Add test for `assert.strictEqual`.
+ * Add test for `assert.notEqual`.
+
+0.4.1 / 2012-02-26
+==================
+
+ * Merge pull request #27 from logicalparadox/type-fix
+ * Update the browser version.
+ * Add should tests for type checks.
+ * Add function type check test.
+ * Add more type checks tests.
+ * Add test for `new Number` type check.
+ * Fix type of actual checks.
+
+0.4.0 / 2012-02-25
+==================
+
+ * docs and readme for upcoming 0.4.0
+ * docs generated
+ * putting coverage and tests for docs in docs/out/support
+ * make docs
+ * makefile copy necessary resources for tests in docs
+ * rename configuration test
+ * Merge pull request #21 from logicalparadox/close-to
+ * Update the browser version.
+ * Update `closeTo()` docs.
+ * Add `Assertion.closeTo()` method.
+ * Add `.closeTo()` should test.
+ * Add `.closeTo()` expect test.
+ * Merge pull request #20 from logicalparadox/satisfy
+ * Update the browser version.
+ * `..` -> `()` in `.satisfy()` should test.
+ * Update example for `.satisfy()`.
+ * Update the compiled browser version.
+ * Add `Assertion.satisfy()` method.
+ * Add `.satisfy()` should test.
+ * Add `.satisfy()` expect test.
+ * Merge pull request #19 from logicalparadox/respond-to
+ * Update the compiled browser version.
+ * Add `respondTo` Assertion.
+ * Add `respondTo` should test.
+ * Add `respondTo` expect test.
+ * Merge branch 'feature/coverage'
+ * mocha coverage support
+ * doc contributors
+ * README contributors
+
+0.3.4 / 2012-02-23
+==================
+
+ * inline comment typos for #15
+ * Merge branch 'refs/heads/jeffbski-configErrorStackCompat'
+ * includeStack documentation for all interfaces
+ * suite name more generic
+ * Update test to be compatible with browsers that do not support err.stack
+ * udpated compiled chai.js and added to browser tests
+ * Allow inclusion of stack trace for Assert error messages to be configurable
+ * docs sharing buttons
+ * sinon-chai link
+ * doc updates
+ * read me updates include plugins
+
+0.3.3 / 2012-02-12
+==================
+
+ * Merge pull request #14 from jfirebaugh/configurable_properties
+ * Make Assertion.prototype properties configurable
+
+0.3.2 / 2012-02-10
+==================
+
+ * codex version
+ * docs
+ * docs cleanup
+
+0.3.1 / 2012-02-07
+==================
+
+ * node 0.4.x compat
+
+0.3.0 / 2012-02-07
+==================
+
+ * Merge branch 'feature/03x'
+ * browser build
+ * remove html/json/headers testign
+ * regex error.message testing
+ * tests for using plugins
+ * Merge pull request #11 from domenic/master
+ * Make `chai.use` a no-op if the function has already been used.
+
+0.2.4 / 2012-02-02
+==================
+
+ * added in past tense switch for `been`
+
+0.2.3 / 2012-02-01
+==================
+
+ * try that again
+
+0.2.2 / 2012-02-01
+==================
+
+ * added `been` (past of `be`) alias
+
+0.2.1 / 2012-01-29
+==================
+
+ * added Throw, with a capital T, as an alias to `throw` (#7)
+
+0.2.0 / 2012-01-26
+==================
+
+ * update gitignore for vim *.swp
+ * Merge branch 'feature/plugins'
+ * browser build
+ * interfaces now work with use
+ * simple .use function. See #9.
+ * readme notice on browser compat
+
+0.1.7 / 2012-01-25
+==================
+
+ * added assert tests to browser test runner
+ * browser update
+ * `should` interface patch for primitives support in FF
+ * fix isObject() Thanks @milewise
+ * travis only on branch `master`
+ * add instanceof alias `instanceOf`. #6
+ * some tests for assert module
+
+0.1.6 / 2012-01-02
+==================
+
+ * commenting for assert interface
+ * updated codex dep
+
+0.1.5 / 2012-01-02
+==================
+
+ * browser tests pass
+ * type in should.not.equal
+ * test for should (not) exist
+ * added should.exist and should.not.exist
+ * browser uses tdd
+ * convert tests to tdd
+
+0.1.4 / 2011-12-26
+==================
+
+ * browser lib update for new assert interface compatiblitiy
+ * inspect typos
+ * added strict equal + negatives and ifError
+ * interface assert had doesNotThrow
+ * added should tests to browser
+ * new expect empty tests
+ * should test browser compat
+ * Fix typo for instanceof docs. Closes #3 [ci skip]
+
+0.1.3 / 2011-12-18
+==================
+
+ * much cleaner reporting string on error.
+
+0.1.2 / 2011-12-18
+==================
+
+ * [docs] for upcoming 0.1.2
+ * browser version built with pre/suffix … all tests passing
+ * make / compile now use prefix/suffix correctly
+ * code clean
+ * prefix/suffix to wrap browser output to prevent conflicts with other `require` methods.
+ * Merge branch 'feature/should4xcompatibility'
+ * compile for browser tests.. all pass
+ * added header/status/html/json
+ * throw tests
+ * should.throw & should.not.throw shortcuts
+ * improved `throw` type detection and messaging
+ * contain is now `include` … keys modifier is now `contain`
+ * removed object() test
+ * removed #respondTo
+ * Merge branch 'bug/2'
+ * replaced __defineGetter__ with defineProperty for all uses
+ * [docs] change mp tracking code
+ * docs site updated with assert (TDD) interface
+ * updated doc comments for assert interface
+
+0.1.1 / 2011-12-16
+==================
+
+ * docs ready for upcoming 0.1.1
+ * readme image fixed [ci skip]
+ * more readme tweaks [ci skip]
+ * réadmet image fixed [ci skip]
+ * documentation
+ * codex locked in version 0.0.5
+ * more comments to assertions for docs
+ * assertions fully commented, browser library updated
+ * adding codex as doc dependancy
+ * prepping for docs
+ * assertion component completely commented for documentation
+ * added exist test
+ * var expect outside of browser if check
+ * added keywords to package.json
+
+0.1.0 / 2011-12-15
+==================
+
+ * failing on purpose successful .. back to normal
+ * testing travis failure
+ * assert#arguments getter
+ * readme typo
+ * updated README
+ * added travis and npmignore
+ * copyright notices … think i got them all
+ * moved expect interface to own file for consistency
+ * assert ui deepEqual
+ * browser tests expect (all working)
+ * browser version built
+ * chai.fail (should ui)
+ * expect tests browser compatible
+ * tests for should and expect (all pass)
+ * moved fail to primary export
+ * should compatibility testing
+ * within, greaterThan, object, keys,
+ * Aliases
+ * Assertion#property now correctly works with negate and undefined values
+ * error message language matches should
+ * Assertion#respondTo
+ * Assertion now uses inspect util
+ * git ignore node modules
+ * should is exported
+ * AssertionError __proto__ from Error.prototype
+ * add should interface for should.js compatibility
+ * moved eql to until folder and added inspect from (joyent/node)
+ * added mocha for testing
+ * browser build for current api
+ * multiple .property assertions
+ * added deep equal from node
+
+0.0.2 / 2011-12-07
+==================
+
+ * cleaner output on error
+ * improved exists detection
+ * package remnant artifact
+ * empty deep equal
+ * test browser build
+ * assertion cleanup
+ * client compile script
+ * makefile
+ * most of the basic assertions
+ * allow no parameters to assertion error
+ * name change
+ * assertion error instance
+ * main exports: assert() & expect()
+ * initialize
View
45 node_modules/chai/Makefile
@@ -0,0 +1,45 @@
+
+TESTS = test/*.js
+REPORTER = spec
+SRC = $(shell find lib -name "*.js" -type f)
+
+all: chai.js
+
+chai.js: $(SRC)
+ @node support/compile $^
+
+clean:
+ @rm -f chai.js
+
+docs: clean-docs
+ @./node_modules/.bin/codex build \
+ -i docs
+ @cp chai.js docs/out/chai.js
+ @mkdir -p docs/out/support/tests
+ @mkdir docs/out/support/coverage
+ @cp node_modules/mocha/mocha.js docs/out/support/tests
+ @cp node_modules/mocha/mocha.css docs/out/support/tests
+ @cp -R test/*.js docs/out/support/tests
+ @cp test/browser/docs.html docs/out/support/tests/index.html
+ @make test-cov
+ @cp coverage.html docs/out/support/coverage/index.html
+ @./node_modules/.bin/codex serve \
+ -d docs/out
+
+clean-docs:
+ @rm -rf docs/out
+
+test:
+ @NODE_ENV=test ./node_modules/.bin/mocha \
+ --reporter $(REPORTER) \
+ --ui tdd \
+ $(TESTS)
+
+test-cov: lib-cov
+ @CHAI_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
+
+lib-cov:
+ @rm -rf lib-cov
+ @jscoverage lib lib-cov
+
+.PHONY: clean test docs clean-docs test-cov lib-cov
View
97 node_modules/chai/README.md
@@ -0,0 +1,97 @@
+[![Build Status](https://secure.travis-ci.org/logicalparadox/chai.png)](http://travis-ci.org/logicalparadox/chai)
+
+[![Chai Documentation](https://github.com/logicalparadox/chai/raw/master/docs/template/assets/img/chai-logo.png)](http://chaijs.com)
+
+Chai is a BDD / TDD assertion library for [node](http://nodejs.org) and the browser that
+can be delightfully paired with any javascript testing framework.
+
+For more information view the [documentation](http://chaijs.com).
+
+## Installation
+
+Chai is available for both node.js and the browser using any
+test framework you like.
+
+### Node.js
+
+Package is available through [npm](http://npmjs.org):
+
+ npm install chai
+
+Recommend adding it to package.json devDependancies.
+
+### Browser
+
+Include the chai browser build in your testing suite.
+
+ <script src="chai.js" type="text/javascript"></script>
+
+Currently supports all modern browsers: IE 9+, Chrome 7+, FireFox 4+, Safari 5+. Want to know if your browser is compatible?
+Run the [online test suite](http://chaijs.com/support/tests/).
+
+## Plugins
+
+The Chai community is growing! Plugins allow developers to expand Chai's available
+assertions. Here is what the community has come up with so far:
+
+* [chai-spies](https://github.com/logicalparadox/chai-spies) is a basic spy implementation for chai. It's also
+a good resource for building chai plugins that work in both node.js and the browser.
+* [chai-jquery](https://github.com/jfirebaugh/chai-jquery) by [@jfirebaugh](https://github.com/jfirebaugh)
+provides deep jQuery integration with chai's `should` and `expect`.
+* [jack](https://github.com/vesln/jack) by [@vesln](https://github.com/vesln) is a mock/stub library that
+can be used as a stand-alone or with chai.
+* [sinon-chai](https://github.com/domenic/sinon-chai) by [@domenic](https://github.com/domenic) extends chai with
+assertions for the Sinon.js mocking framework.
+
+## Getting Help
+
+If you have questions or issues, please use this projects
+[Github Issues](https://github.com/logicalparadox/chai/issues). You can also keep up to date
+on the [Google Group](http://groups.google.com/group/chaijs) or ping [@jakeluer](http://twitter.com/jakeluer)
+directly on Twitter. Chai developers can also be found on Freenode IRC in #letstest.js.
+
+## Versions
+
+The current stable version tree is the `0.5.x` tree on the `master` branch. If you are interested in seeing
+what we have planned, or if you are a plugin developer interested in preparing your plugins for the
+next major release, see the `0.6.x` branch.
+
+- Stable: 0.5.x
+- Unstables: 0.6.x
+
+## Contributors
+
+ commits: 252
+ files : 71
+ authors:
+ 192 Jake Luer 76.2%
+ 53 Veselin Todorov 21.0%
+ 3 Jeff Barczewski 1.2%
+ 1 Vinay Pulim 0.4%
+ 1 Jo Liss 0.4%
+ 1 Domenic Denicola 0.4%
+ 1 John Firebaugh 0.4%
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2011-2012 Jake Luer <jake@alogicalparadox.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
2,223 node_modules/chai/chai.js
@@ -0,0 +1,2223 @@
+!function (name, definition) {
+ if (typeof define == 'function' && typeof define.amd == 'object') define(definition);
+ else this[name] = definition();
+}('chai', function () {
+
+// CommonJS require()
+
+function require(p){
+ var path = require.resolve(p)
+ , mod = require.modules[path];
+ if (!mod) throw new Error('failed to require "' + p + '"');
+ if (!mod.exports) {
+ mod.exports = {};
+ mod.call(mod.exports, mod, mod.exports, require.relative(path));
+ }
+ return mod.exports;
+ }
+
+require.modules = {};
+
+require.resolve = function (path){
+ var orig = path
+ , reg = path + '.js'
+ , index = path + '/index.js';
+ return require.modules[reg] && reg
+ || require.modules[index] && index
+ || orig;
+ };
+
+require.register = function (path, fn){
+ require.modules[path] = fn;
+ };
+
+require.relative = function (parent) {
+ return function(p){
+ if ('.' != p[0]) return require(p);
+
+ var path = parent.split('/')
+ , segs = p.split('/');
+ path.pop();
+
+ for (var i = 0; i < segs.length; i++) {
+ var seg = segs[i];
+ if ('..' == seg) path.pop();
+ else if ('.' != seg) path.push(seg);
+ }
+
+ return require(path.join('/'));
+ };
+ };
+
+
+require.register("assertion.js", function(module, exports, require){
+/*!
+ * chai
+ * Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
+ * MIT Licensed
+ *
+ * Primarily a refactor of: should.js
+ * https://github.com/visionmedia/should.js
+ * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
+ * MIT Licensed
+ */
+
+/**
+ * ### BDD Style Introduction
+ *
+ * The BDD style is exposed through `expect` or `should` interfaces. In both
+ * scenarios, you chain together natural language assertions.
+ *
+ * // expect
+ * var expect = require('chai').expect;
+ * expect(foo).to.equal('bar');
+ *
+ * // should
+ * var should = require('chai').should();
+ * foo.should.equal('bar');
+ *
+ * #### Differences
+ *
+ * The `expect` interface provides a function as a starting point for chaining
+ * your language assertions. It works on node.js and in all browsers.
+ *
+ * The `should` interface extends `Object.prototype` to provide a single getter as
+ * the starting point for your language assertions. It works on node.js and in
+ * all browsers except Internet Explorer.
+ *
+ * #### Configuration
+ *
+ * By default, Chai does not show stack traces upon an AssertionError. This can
+ * be changed by modifying the `includeStack` parameter for chai.Assertion. For example:
+ *
+ * var chai = require('chai');
+ * chai.Assertion.includeStack = true; // defaults to false
+ */
+
+/*!
+ * Module dependencies.
+ */
+
+var AssertionError = require('./error')
+ , eql = require('./utils/eql')
+ , toString = Object.prototype.toString
+ , inspect = require('./utils/inspect');
+
+/*!
+ * Module export.
+ */
+
+module.exports = Assertion;
+
+
+/*!
+ * # Assertion Constructor
+ *
+ * Creates object for chaining.
+ *
+ * @api private
+ */
+
+function Assertion (obj, msg, stack) {
+ this.ssfi = stack || arguments.callee;
+ this.obj = obj;
+ this.msg = msg;
+}
+
+/*!
+ * ## Assertion.includeStack
+ * , toString = Object.prototype.toString
+ *
+ * User configurable property, influences whether stack trace
+ * is included in Assertion error message. Default of false
+ * suppresses stack trace in the error message
+ *
+ * Assertion.includeStack = true; // enable stack on error
+ *
+ * @api public
+ */
+
+Assertion.includeStack = false;
+
+/*!
+ * # .assert(expression, message, negateMessage, expected, actual)
+ *
+ * Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass.
+ *
+ * @name assert
+ * @param {Philosophical} expression to be tested
+ * @param {String} message to display if fails
+ * @param {String} negatedMessage to display if negated expression fails
+ * @param {*} expected value (remember to check for negation)
+ * @param {*} actual (optional) will default to `this.obj`
+ * @api private
+ */
+
+Assertion.prototype.assert = function (expr, msg, negateMsg, expected, actual) {
+ actual = actual || this.obj;
+ var msg = (this.negate ? negateMsg : msg)
+ , ok = this.negate ? !expr : expr;
+
+ if (!ok) {
+ throw new AssertionError({
+ message: this.msg ? this.msg + ': ' + msg : msg // include custom message if available
+ , actual: actual
+ , expected: expected
+ , stackStartFunction: (Assertion.includeStack) ? this.assert : this.ssfi
+ });
+ }
+};
+
+/*!
+ * # inspect
+ *
+ * Returns the current object stringified.
+ *
+ * @name inspect
+ * @api private
+ */
+
+Object.defineProperty(Assertion.prototype, 'inspect',
+ { get: function () {
+ return inspect(this.obj);
+ }
+ , configurable: true
+});
+
+/**
+ * # to
+ *
+ * Language chain.
+ *
+ * @name to
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'to',
+ { get: function () {
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # be
+ *
+ * Language chain.
+ *
+ * @name be
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'be',
+ { get: function () {
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # been
+ *
+ * Language chain. Also tests `tense` to past for addon
+ * modules that use the tense feature.
+ *
+ * @name been
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'been',
+ { get: function () {
+ this.tense = 'past';
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # an
+ *
+ * Language chain.
+ *
+ * @name an
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'an',
+ { get: function () {
+ return this;
+ }
+ , configurable: true
+});
+/**
+ * # is
+ *
+ * Language chain.
+ *
+ * @name is
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'is',
+ { get: function () {
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # and
+ *
+ * Language chain.
+ *
+ * @name and
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'and',
+ { get: function () {
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # have
+ *
+ * Language chain.
+ *
+ * @name have
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'have',
+ { get: function () {
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # with
+ *
+ * Language chain.
+ *
+ * @name with
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'with',
+ { get: function () {
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # .not
+ *
+ * Negates any of assertions following in the chain.
+ *
+ * @name not
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'not',
+ { get: function () {
+ this.negate = true;
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # .ok
+ *
+ * Assert object truthiness.
+ *
+ * expect('everthing').to.be.ok;
+ * expect(false).to.not.be.ok;
+ * expect(undefined).to.not.be.ok;
+ * expect(null).to.not.be.ok;
+ *
+ * @name ok
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'ok',
+ { get: function () {
+ this.assert(
+ this.obj
+ , 'expected ' + this.inspect + ' to be truthy'
+ , 'expected ' + this.inspect + ' to be falsy');
+
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # .true
+ *
+ * Assert object is true
+ *
+ * @name true
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'true',
+ { get: function () {
+ this.assert(
+ true === this.obj
+ , 'expected ' + this.inspect + ' to be true'
+ , 'expected ' + this.inspect + ' to be false'
+ , this.negate ? false : true
+ );
+
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # .false
+ *
+ * Assert object is false
+ *
+ * @name false
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'false',
+ { get: function () {
+ this.assert(
+ false === this.obj
+ , 'expected ' + this.inspect + ' to be false'
+ , 'expected ' + this.inspect + ' to be true'
+ , this.negate ? true : false
+ );
+
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # .exist
+ *
+ * Assert object exists (null).
+ *
+ * var foo = 'hi'
+ * , bar;
+ * expect(foo).to.exist;
+ * expect(bar).to.not.exist;
+ *
+ * @name exist
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'exist',
+ { get: function () {
+ this.assert(
+ null != this.obj
+ , 'expected ' + this.inspect + ' to exist'
+ , 'expected ' + this.inspect + ' to not exist'
+ );
+
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # .empty
+ *
+ * Assert object's length to be 0.
+ *
+ * expect([]).to.be.empty;
+ *
+ * @name empty
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'empty',
+ { get: function () {
+ var expected = this.obj;
+
+ if (Array.isArray(this.obj)) {
+ expected = this.obj.length;
+ } else if (typeof this.obj === 'object') {
+ expected = Object.keys(this.obj).length;
+ }
+
+ this.assert(
+ !expected
+ , 'expected ' + this.inspect + ' to be empty'
+ , 'expected ' + this.inspect + ' not to be empty');
+
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # .arguments
+ *
+ * Assert object is an instanceof arguments.
+ *
+ * function test () {
+ * expect(arguments).to.be.arguments;
+ * }
+ *
+ * @name arguments
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'arguments',
+ { get: function () {
+ this.assert(
+ '[object Arguments]' == Object.prototype.toString.call(this.obj)
+ , 'expected ' + this.inspect + ' to be arguments'
+ , 'expected ' + this.inspect + ' to not be arguments'
+ , '[object Arguments]'
+ , Object.prototype.toString.call(this.obj)
+ );
+
+ return this;
+ }
+ , configurable: true
+});
+
+/**
+ * # .equal(value)
+ *
+ * Assert strict equality.
+ *
+ * expect('hello').to.equal('hello');
+ *
+ * @name equal
+ * @param {*} value
+ * @api public
+ */
+
+Assertion.prototype.equal = function (val) {
+ this.assert(
+ val === this.obj
+ , 'expected ' + this.inspect + ' to equal ' + inspect(val)
+ , 'expected ' + this.inspect + ' to not equal ' + inspect(val)
+ , val );
+
+ return this;
+};
+
+/**
+ * # .eql(value)
+ *
+ * Assert deep equality.
+ *
+ * expect({ foo: 'bar' }).to.eql({ foo: 'bar' });
+ *
+ * @name eql
+ * @param {*} value
+ * @api public
+ */
+
+Assertion.prototype.eql = function (obj) {
+ this.assert(
+ eql(obj, this.obj)
+ , 'expected ' + this.inspect + ' to equal ' + inspect(obj)
+ , 'expected ' + this.inspect + ' to not equal ' + inspect(obj)
+ , obj );
+
+ return this;
+};
+
+/**
+ * # .above(value)
+ *
+ * Assert greater than `value`.
+ *
+ * expect(10).to.be.above(5);
+ *
+ * @name above
+ * @param {Number} value
+ * @api public
+ */
+
+Assertion.prototype.above = function (val) {
+ this.assert(
+ this.obj > val
+ , 'expected ' + this.inspect + ' to be above ' + val
+ , 'expected ' + this.inspect + ' to be below ' + val);
+
+ return this;
+};
+
+/**
+ * # .below(value)
+ *
+ * Assert less than `value`.
+ *
+ * expect(5).to.be.below(10);
+ *
+ * @name below
+ * @param {Number} value
+ * @api public
+ */
+
+Assertion.prototype.below = function (val) {
+ this.assert(
+ this.obj < val
+ , 'expected ' + this.inspect + ' to be below ' + val
+ , 'expected ' + this.inspect + ' to be above ' + val);
+
+ return this;
+};
+
+/**
+ * # .within(start, finish)
+ *
+ * Assert that a number is within a range.
+ *
+ * expect(7).to.be.within(5,10);
+ *
+ * @name within
+ * @param {Number} start lowerbound inclusive
+ * @param {Number} finish upperbound inclusive
+ * @api public
+ */
+
+Assertion.prototype.within = function (start, finish) {
+ var range = start + '..' + finish;
+
+ this.assert(
+ this.obj >= start && this.obj <= finish
+ , 'expected ' + this.inspect + ' to be within ' + range
+ , 'expected ' + this.inspect + ' to not be within ' + range);
+
+ return this;
+};
+
+/**
+ * # .a(type)
+ *
+ * Assert typeof.
+ *
+ * expect('test').to.be.a('string');
+ *
+ * @name a
+ * @param {String} type
+ * @api public
+ */
+
+Assertion.prototype.a = function (type) {
+ var klass = type.charAt(0).toUpperCase() + type.slice(1);
+
+ this.assert(
+ '[object ' + klass + ']' === toString.call(this.obj)
+ , 'expected ' + this.inspect + ' to be a ' + type
+ , 'expected ' + this.inspect + ' not to be a ' + type
+ , '[object ' + klass + ']'
+ , toString.call(this.obj)
+ );
+
+ return this;
+};
+
+/**
+ * # .instanceof(constructor)
+ *
+ * Assert instanceof.
+ *
+ * var Tea = function (name) { this.name = name; }
+ * , Chai = new Tea('chai');
+ *
+ * expect(Chai).to.be.an.instanceOf(Tea);
+ *
+ * @name instanceof
+ * @param {Constructor}
+ * @alias instanceOf
+ * @api public
+ */
+
+Assertion.prototype.instanceof = function (constructor) {
+ var name = constructor.name;
+ this.assert(
+ this.obj instanceof constructor
+ , 'expected ' + this.inspect + ' to be an instance of ' + name
+ , 'expected ' + this.inspect + ' to not be an instance of ' + name);
+
+ return this;
+};
+
+/**
+ * # .property(name, [value])
+ *
+ * Assert that property of `name` exists, optionally with `value`.
+ *
+ * var obj = { foo: 'bar' }
+ * expect(obj).to.have.property('foo');
+ * expect(obj).to.have.property('foo', 'bar');
+ * expect(obj).to.have.property('foo').to.be.a('string');
+ *
+ * @name property
+ * @param {String} name
+ * @param {*} value (optional)
+ * @returns value of property for chaining
+ * @api public
+ */
+
+Assertion.prototype.property = function (name, val) {
+ if (this.negate && undefined !== val) {
+ if (undefined === this.obj[name]) {
+ throw new Error(this.inspect + ' has no property ' + inspect(name));
+ }
+ } else {
+ this.assert(
+ undefined !== this.obj[name]
+ , 'expected ' + this.inspect + ' to have a property ' + inspect(name)
+ , 'expected ' + this.inspect + ' to not have property ' + inspect(name));
+ }
+
+ if (undefined !== val) {
+ this.assert(
+ val === this.obj[name]
+ , 'expected ' + this.inspect + ' to have a property ' + inspect(name) + ' of ' +
+ inspect(val) + ', but got ' + inspect(this.obj[name])
+ , 'expected ' + this.inspect + ' to not have a property ' + inspect(name) + ' of ' + inspect(val)
+ , val
+ , this.obj[val]
+ );
+ }
+
+ this.obj = this.obj[name];
+ return this;
+};
+
+/**
+ * # .ownProperty(name)
+ *
+ * Assert that has own property by `name`.
+ *
+ * expect('test').to.have.ownProperty('length');
+ *
+ * @name ownProperty
+ * @alias haveOwnProperty
+ * @param {String} name
+ * @api public
+ */
+
+Assertion.prototype.ownProperty = function (name) {
+ this.assert(
+ this.obj.hasOwnProperty(name)
+ , 'expected ' + this.inspect + ' to have own property ' + inspect(name)
+ , 'expected ' + this.inspect + ' to not have own property ' + inspect(name));
+ return this;
+};
+
+/**
+ * # .length(val)
+ *
+ * Assert that object has expected length.
+ *
+ * expect([1,2,3]).to.have.length(3);
+ * expect('foobar').to.have.length(6);
+ *
+ * @name length
+ * @alias lengthOf
+ * @param {Number} length
+ * @api public
+ */
+
+Assertion.prototype.length = function (n) {
+ new Assertion(this.obj).to.have.property('length');
+ var len = this.obj.length;
+
+ this.assert(
+ len == n
+ , 'expected ' + this.inspect + ' to have a length of ' + n + ' but got ' + len
+ , 'expected ' + this.inspect + ' to not have a length of ' + len
+ , n
+ , len
+ );
+
+ return this;
+};
+
+/**
+ * # .match(regexp)
+ *
+ * Assert that matches regular expression.
+ *
+ * expect('foobar').to.match(/^foo/);
+ *
+ * @name match
+ * @param {RegExp} RegularExpression
+ * @api public
+ */
+
+Assertion.prototype.match = function (re) {
+ this.assert(
+ re.exec(this.obj)
+ , 'expected ' + this.inspect + ' to match ' + re
+ , 'expected ' + this.inspect + ' not to match ' + re);
+
+ return this;
+};
+
+/**
+ * # .include(obj)
+ *
+ * Assert the inclusion of an object in an Array or substring in string.
+ *
+ * expect([1,2,3]).to.include(2);
+ *
+ * @name include
+ * @param {Object|String|Number} obj
+ * @api public
+ */
+
+Assertion.prototype.include = function (obj) {
+ this.assert(
+ ~this.obj.indexOf(obj)
+ , 'expected ' + this.inspect + ' to include ' + inspect(obj)
+ , 'expected ' + this.inspect + ' to not include ' + inspect(obj));
+
+ return this;
+};
+
+/**
+ * # .string(string)
+ *
+ * Assert inclusion of string in string.
+ *
+ * expect('foobar').to.have.string('bar');
+ *
+ * @name string
+ * @param {String} string
+ * @api public
+ */
+
+Assertion.prototype.string = function (str) {
+ new Assertion(this.obj).is.a('string');
+
+ this.assert(
+ ~this.obj.indexOf(str)
+ , 'expected ' + this.inspect + ' to contain ' + inspect(str)
+ , 'expected ' + this.inspect + ' to not contain ' + inspect(str));
+
+ return this;
+};
+
+
+
+/**
+ * # contain
+ *
+ * Toggles the `contain` flag for the `keys` assertion.
+ *
+ * @name contain
+ * @api public
+ */
+
+Object.defineProperty(Assertion.prototype, 'contain',
+ { get: function () {
+ this.contains = true;
+ return this;
+ },
+ configurable: true
+});
+
+/**
+ * # .keys(key1, [key2], [...])
+ *
+ * Assert exact keys or the inclusing of keys using the `contain` modifier.
+ *
+ * expect({ foo: 1, bar: 2 }).to.have.keys(['foo', 'bar']);
+ * expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('foo', 'bar');
+ *
+ * @name keys
+ * @alias key
+ * @param {String|Array} Keys
+ * @api public
+ */
+
+Assertion.prototype.keys = function(keys) {
+ var str
+ , ok = true;
+
+ keys = keys instanceof Array
+ ? keys
+ : Array.prototype.slice.call(arguments);
+
+ if (!keys.length) throw new Error('keys required');
+
+ var actual = Object.keys(this.obj)
+ , len = keys.length;
+
+ // Inclusion
+ ok = keys.every(function(key){
+ return ~actual.indexOf(key);
+ });
+
+ // Strict
+ if (!this.negate && !this.contains) {
+ ok = ok && keys.length == actual.length;
+ }
+
+ // Key string
+ if (len > 1) {
+ keys = keys.map(function(key){
+ return inspect(key);
+ });
+ var last = keys.pop();
+ str = keys.join(', ') + ', and ' + last;
+ } else {
+ str = inspect(keys[0]);
+ }
+
+ // Form
+ str = (len > 1 ? 'keys ' : 'key ') + str;
+
+ // Have / include
+ str = (this.contains ? 'contain ' : 'have ') + str;
+
+ // Assertion
+ this.assert(
+ ok
+ , 'expected ' + this.inspect + ' to ' + str
+ , 'expected ' + this.inspect + ' to not ' + str
+ , keys
+ , Object.keys(this.obj)
+ );
+
+ return this;
+}
+
+/**
+ * # .throw(constructor)
+ *
+ * Assert that a function will throw a specific type of error or that error
+ * thrown will match a RegExp or include a string.
+ *
+ * var fn = function () { throw new ReferenceError('This is a bad function.'); }
+ * expect(fn).to.throw(ReferenceError);
+ * expect(fn).to.throw(/bad function/);
+ * expect(fn).to.not.throw('good function');
+ * expect(fn).to.throw(ReferenceError, /bad function/);
+ *
+ * Please note that when a throw expectation is negated, it will check each
+ * parameter independently, starting with Error constructor type. The appropriate way
+ * to check for the existence of a type of error but for a message that does not match
+ * is to use `and`.
+ *
+ * expect(fn).to.throw(ReferenceError).and.not.throw(/good function/);
+ *
+ * @name throw
+ * @alias throws
+ * @alias Throw
+ * @param {ErrorConstructor} constructor
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
+ * @api public
+ */
+
+Assertion.prototype.throw = function (constructor, msg) {
+ new Assertion(this.obj).is.a('function');
+
+ var thrown = false;
+
+ if (arguments.length === 0) {
+ msg = null;
+ constructor = null;
+ } else if (constructor && (constructor instanceof RegExp || 'string' === typeof constructor)) {
+ msg = constructor;
+ constructor = null;
+ }
+
+ try {
+ this.obj();
+ } catch (err) {
+ // first, check constructor
+ if (constructor && 'function' === typeof constructor) {
+ this.assert(
+ err instanceof constructor && err.name == constructor.name
+ , 'expected ' + this.inspect + ' to throw ' + constructor.name + ' but a ' + err.name + ' was thrown'
+ , 'expected ' + this.inspect + ' to not throw ' + constructor.name );
+ if (!msg) return this;
+ }
+ // next, check message
+ if (err.message && msg && msg instanceof RegExp) {
+ this.assert(
+ msg.exec(err.message)
+ , 'expected ' + this.inspect + ' to throw error matching ' + msg + ' but got ' + inspect(err.message)
+ , 'expected ' + this.inspect + ' to throw error not matching ' + msg
+ );
+ return this;
+ } else if (err.message && msg && 'string' === typeof msg) {
+ this.assert(
+ ~err.message.indexOf(msg)
+ , 'expected ' + this.inspect + ' to throw error including ' + inspect(msg) + ' but got ' + inspect(err.message)
+ , 'expected ' + this.inspect + ' to throw error not including ' + inspect(msg)
+ );
+ return this;
+ } else {
+ thrown = true;
+ }
+ }
+
+ var name = (constructor ? constructor.name : 'an error');
+
+ this.assert(
+ thrown === true
+ , 'expected ' + this.inspect + ' to throw ' + name
+ , 'expected ' + this.inspect + ' to not throw ' + name);
+
+ return this;
+};
+
+/**
+ * # .respondTo(method)
+ *
+ * Assert that object/class will respond to a method.
+ *
+ * expect(Klass).to.respondTo('bar');
+ * expect(obj).to.respondTo('bar');
+ *
+ * @name respondTo
+ * @param {String} method
+ * @api public
+ */
+
+Assertion.prototype.respondTo = function (method) {
+ var context = ('function' === typeof this.obj)
+ ? this.obj.prototype[method]
+ : this.obj[method];
+
+ this.assert(
+ 'function' === typeof context
+ , 'expected ' + this.inspect + ' to respond to ' + inspect(method)
+ , 'expected ' + this.inspect + ' to not respond to ' + inspect(method)
+ , 'function'
+ , typeof context
+ );
+
+ return this;
+};
+
+/**
+ * # .satisfy(method)
+ *
+ * Assert that passes a truth test.
+ *
+ * expect(1).to.satisfy(function(num) { return num > 0; });
+ *
+ * @name satisfy
+ * @param {Function} matcher
+ * @api public
+ */
+
+Assertion.prototype.satisfy = function (matcher) {
+ this.assert(
+ matcher(this.obj)
+ , 'expected ' + this.inspect + ' to satisfy ' + inspect(matcher)
+ , 'expected ' + this.inspect + ' to not satisfy' + inspect(matcher)
+ , this.negate ? false : true
+ , matcher(this.obj)
+ );
+
+ return this;
+};
+
+/**
+ * # .closeTo(expected, delta)
+ *
+ * Assert that actual is equal to +/- delta.
+ *
+ * expect(1.5).to.be.closeTo(1, 0.5);
+ *
+ * @name closeTo
+ * @param {Number} expected
+ * @param {Number} delta
+ * @api public
+ */
+
+Assertion.prototype.closeTo = function (expected, delta) {
+ this.assert(
+ (this.obj - delta === expected) || (this.obj + delta === expected)
+ , 'expected ' + this.inspect + ' to be close to ' + expected + ' +/- ' + delta
+ , 'expected ' + this.inspect + ' not to be close to ' + expected + ' +/- ' + delta);
+
+ return this;
+};
+
+/*!
+ * Aliases.
+ */
+
+(function alias(name, as){
+ Assertion.prototype[as] = Assertion.prototype[name];
+ return alias;
+})
+('length', 'lengthOf')
+('keys', 'key')
+('ownProperty', 'haveOwnProperty')
+('above', 'greaterThan')
+('below', 'lessThan')
+('throw', 'throws')
+('throw', 'Throw') // for troublesome browsers
+('instanceof', 'instanceOf');
+
+}); // module: assertion.js
+
+require.register("chai.js", function(module, exports, require){
+/*!
+ * chai
+ * Copyright(c) 2011-2012 Jake Luer <jake@alogicalparadox.com>
+ * MIT Licensed
+ */
+
+var used = [];
+var exports = module.exports = {};
+
+exports.version = '0.5.2';
+
+exports.Assertion = require('./assertion');
+exports.AssertionError = require('./error');
+
+exports.inspect = require('./utils/inspect');
+
+exports.use = function (fn) {
+ if (!~used.indexOf(fn)) {
+ fn(this);
+ used.push(fn);
+ }
+
+ return this;
+};
+
+var expect = require('./interface/expect');
+exports.use(expect);
+
+var should = require('./interface/should');
+exports.use(should);
+
+var assert = require('./interface/assert');
+exports.use(assert);
+
+}); // module: chai.js
+
+require.register("error.js", function(module, exports, require){
+/*!
+ * chai
+ * Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
+ * MIT Licensed
+ */
+
+var fail = require('./chai').fail;
+
+module.exports = AssertionError;
+
+/*!
+ * Inspired by node.js assert module
+ * https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/assert.js
+ */
+function AssertionError (options) {
+ options = options || {};
+ this.name = 'AssertionError';
+ this.message = options.message;
+ this.actual = options.actual;
+ this.expected = options.expected;
+ this.operator = options.operator;
+ var stackStartFunction = options.stackStartFunction || fail;
+
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, stackStartFunction);
+ }
+}
+
+AssertionError.prototype.__proto__ = Error.prototype;
+
+AssertionError.prototype.toString = function() {
+ return this.message;
+};
+
+}); // module: error.js
+
+require.register("interface/assert.js", function(module, exports, require){
+/*!
+ * chai
+ * Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
+ * MIT Licensed
+ */
+
+/**
+ * ### TDD Style Introduction
+ *
+ * The TDD style is exposed through `assert` interfaces. This provides
+ * the classic assert.`test` notation, similiar to that packaged with
+ * node.js. This assert module, however, provides several additional
+ * tests and is browser compatible.
+ *
+ * // assert
+ * var assert = require('chai').assert;
+ * , foo = 'bar';
+ *
+ * assert.typeOf(foo, 'string');
+ * assert.equal(foo, 'bar');
+ *
+ * #### Configuration
+ *
+ * By default, Chai does not show stack traces upon an AssertionError. This can
+ * be changed by modifying the `includeStack` parameter for chai.Assertion. For example:
+ *
+ * var chai = require('chai');
+ * chai.Assertion.includeStack = true; // defaults to false
+ */
+
+module.exports = function (chai) {
+ /*!
+ * Chai dependencies.
+ */
+ var Assertion = chai.Assertion
+ , inspect = chai.inspect;
+
+ /*!
+ * Module export.
+ */
+
+ var assert = chai.assert = {};
+
+ /**
+ * # .fail(actual, expect, msg, operator)
+ *
+ * Throw a failure. Node.js compatible.
+ *
+ * @name fail
+ * @param {*} actual value
+ * @param {*} expected value
+ * @param {String} message
+ * @param {String} operator
+ * @api public
+ */
+
+ assert.fail = function (actual, expected, message, operator) {
+ throw new chai.AssertionError({
+ actual: actual
+ , expected: expected
+ , message: message
+ , operator: operator
+ , stackStartFunction: assert.fail
+ });
+ }
+
+ /**
+ * # .ok(object, [message])
+ *
+ * Assert object is truthy.
+ *
+ * assert.ok('everthing', 'everything is ok');
+ * assert.ok(false, 'this will fail');
+ *
+ * @name ok
+ * @param {*} object to test
+ * @param {String} message
+ * @api public
+ */
+
+ assert.ok = function (val, msg) {
+ new Assertion(val, msg).is.ok;
+ };
+
+ /**
+ * # .equal(actual, expected, [message])
+ *
+ * Assert strict equality.
+ *
+ * assert.equal(3, 3, 'these numbers are equal');
+ *
+ * @name equal
+ * @param {*} actual
+ * @param {*} expected
+ * @param {String} message
+ * @api public
+ */
+
+ assert.equal = function (act, exp, msg) {
+ var test = new Assertion(act, msg);
+
+ test.assert(
+ exp == test.obj
+ , 'expected ' + test.inspect + ' to equal ' + inspect(exp)
+ , 'expected ' + test.inspect + ' to not equal ' + inspect(exp));
+ };
+
+ /**
+ * # .notEqual(actual, expected, [message])
+ *
+ * Assert not equal.
+ *
+ * assert.notEqual(3, 4, 'these numbers are not equal');
+ *
+ * @name notEqual
+ * @param {*} actual
+ * @param {*} expected
+ * @param {String} message
+ * @api public
+ */
+
+ assert.notEqual = function (act, exp, msg) {
+ var test = new Assertion(act, msg);
+
+ test.assert(
+ exp != test.obj
+ , 'expected ' + test.inspect + ' to equal ' + inspect(exp)
+ , 'expected ' + test.inspect + ' to not equal ' + inspect(exp));
+ };
+
+ /**
+ * # .strictEqual(actual, expected, [message])
+ *
+ * Assert strict equality.
+ *
+ * assert.strictEqual(true, true, 'these booleans are strictly equal');
+ *
+ * @name strictEqual
+ * @param {*} actual
+ * @param {*} expected
+ * @param {String} message
+ * @api public
+ */
+
+ assert.strictEqual = function (act, exp, msg) {
+ new Assertion(act, msg).to.equal(exp);
+ };
+
+ /**
+ * # .notStrictEqual(actual, expected, [message])
+ *
+ * Assert strict equality.
+ *
+ * assert.notStrictEqual(1, true, 'these booleans are not strictly equal');
+ *
+ * @name notStrictEqual
+ * @param {*} actual
+ * @param {*} expected
+ * @param {String} message
+ * @api public
+ */
+
+ assert.notStrictEqual = function (act, exp, msg) {
+ new Assertion(act, msg).to.not.equal(exp);
+ };
+
+ /**
+ * # .deepEqual(actual, expected, [message])
+ *
+ * Assert not deep equality.
+ *
+ * assert.deepEqual({ tea: 'green' }, { tea: 'green' });
+ *
+ * @name deepEqual
+ * @param {*} actual
+ * @param {*} expected
+ * @param {String} message
+ * @api public
+ */
+
+ assert.deepEqual = function (act, exp, msg) {
+ new Assertion(act, msg).to.eql(exp);
+ };
+
+ /**
+ * # .notDeepEqual(actual, expected, [message])
+ *
+ * Assert not deep equality.
+ *
+ * assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' });
+ *
+ * @name notDeepEqual
+ * @param {*} actual
+ * @param {*} expected
+ * @param {String} message
+ * @api public
+ */
+
+ assert.notDeepEqual = function (act, exp, msg) {
+ new Assertion(act, msg).to.not.eql(exp);
+ };
+
+ /**
+ * # .isTrue(value, [message])
+ *
+ * Assert `value` is true.
+ *
+ * var tea_served = true;
+ * assert.isTrue(tea_served, 'the tea has been served');
+ *
+ * @name isTrue
+ * @param {Boolean} value
+ * @param {String} message
+ * @api public
+ */
+
+ assert.isTrue = function (val, msg) {
+ new Assertion(val, msg).is.true;
+ };
+
+ /**
+ * # .isFalse(value, [message])
+ *
+ * Assert `value` is false.
+ *
+ * var tea_served = false;
+ * assert.isFalse(tea_served, 'no tea yet? hmm...');
+ *
+ * @name isFalse
+ * @param {Boolean} value
+ * @param {String} message
+ * @api public
+ */
+
+ assert.isFalse = function (val, msg) {
+ new Assertion(val, msg).is.false;
+ };
+
+ /**
+ * # .isNull(value, [message])
+ *
+ * Assert `value` is null.
+ *
+ * assert.isNull(err, 'no errors');
+ *
+ * @name isNull
+ * @param {*} value
+ * @param {String} message
+ * @api public
+ */
+
+ assert.isNull = function (val, msg) {
+ new Assertion(val, msg).to.equal(null);
+ };
+
+ /**
+ * # .isNotNull(value, [message])
+ *
+ * Assert `value` is not null.
+ *
+ * var tea = 'tasty chai';
+ * assert.isNotNull(tea, 'great, time for tea!');
+ *
+ * @name isNotNull
+ * @param {*} value
+ * @param {String} message
+ * @api public
+ */
+
+ assert.isNotNull = function (val, msg) {
+ new Assertion(val, msg).to.not.equal(null);
+ };
+
+ /**
+ * # .isUndefined(value, [message])
+ *
+ * Assert `value` is undefined.
+ *
+ * assert.isUndefined(tea, 'no tea defined');
+ *
+ * @name isUndefined
+ * @param {*} value
+ * @param {String} message
+ * @api public
+ */
+
+ assert.isUndefined = function (val, msg) {
+ new Assertion(val, msg).to.equal(undefined);
+ };
+
+ /**
+ * # .isDefined(value, [message])
+ *
+ * Assert `value` is not undefined.
+ *
+ * var tea = 'cup of chai';
+ * assert.isDefined(tea, 'no tea defined');
+ *
+ * @name isUndefined
+ * @param {*} value
+ * @param {String} message
+ * @api public
+ */
+
+ assert.isDefined = function (val, msg) {
+ new Assertion(val, msg).to.not.equal(undefined);
+ };
+
+ /**
+ * # .isFunction(value, [message])
+ *
+ * Assert `value` is a function.
+ *
+ * var serve_tea = function () { return 'cup of tea'; };
+ * assert.isFunction(serve_tea, 'great, we can have tea now');
+ *
+ * @name isFunction
+ * @param {Function} value
+ * @param {String} message
+ * @api public
+ */
+
+ assert.isFunction = function (val, msg) {
+ new Assertion(val, msg).to.be.a('function');
+ };
+
+ /**
+ * # .isObject(value, [message])
+ *
+ * Assert `value` is an object.
+ *
+ * var selection = { name: 'Chai', serve: 'with spices' };
+ * assert.isObject(selection, 'tea selection is an object');
+ *
+ * @name isObject
+ * @param {Object} value
+ * @param {String} message
+ * @api public
+ */
+
+ assert.isObject = function (val, msg) {
+ new Assertion(val, msg).to.be.a('object');
+ };
+
+ /**
+ * # .isArray(value, [message])
+ *
+ * Assert `value` is an instance of Array.
+ *
+ * var menu = [ 'green', 'chai', 'oolong' ];
+ * assert.isArray(menu, 'what kind of tea do we want?');
+ *
+ * @name isArray
+ * @param {*} value
+ * @param {String} message
+ * @api public
+ */
+
+ assert.isArray = function (val, msg) {
+ new Assertion(val, msg).to.be.instanceof(Array);
+ };
+
+ /**
+ * # .isString(value, [message])
+ *