ende 0.5.20 → 0.5.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +4 -4
  2. data/component.json +1 -1
  3. data/components/indefinido/indemma/master/.gitignore +17 -0
  4. data/components/indefinido/indemma/master/.ruby-gemset +1 -0
  5. data/components/indefinido/indemma/master/.ruby-version +1 -0
  6. data/components/indefinido/indemma/master/Gemfile +12 -0
  7. data/components/indefinido/indemma/master/Guardfile +39 -0
  8. data/components/indefinido/indemma/master/History.md +0 -0
  9. data/components/indefinido/indemma/master/Readme.md +445 -0
  10. data/components/indefinido/indemma/master/build/development.js +26123 -0
  11. data/components/indefinido/indemma/master/build/release.js +16741 -0
  12. data/components/indefinido/indemma/master/build/test.js +26123 -0
  13. data/components/indefinido/indemma/master/component.json +1 -1
  14. data/components/indefinido/indemma/master/components/chaijs/assertion-error/1.0.0/component.json +18 -0
  15. data/components/indefinido/indemma/master/components/chaijs/assertion-error/1.0.0/index.js +110 -0
  16. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/.gitignore +22 -0
  17. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/.mailmap +1 -0
  18. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/.npmignore +14 -0
  19. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/.travis.yml +14 -0
  20. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/CONTRIBUTING.md +173 -0
  21. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/History.md +895 -0
  22. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/Makefile +93 -0
  23. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/README.md +99 -0
  24. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/ReleaseNotes.md +482 -0
  25. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/bower.json +27 -0
  26. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/chai.js +4782 -0
  27. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/component.json +50 -0
  28. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/index.js +1 -0
  29. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/karma.conf.js +28 -0
  30. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/karma.sauce.js +41 -0
  31. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/assertion.js +130 -0
  32. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/config.js +50 -0
  33. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/core/assertions.js +1314 -0
  34. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/interface/assert.js +1056 -0
  35. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/interface/expect.js +12 -0
  36. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/interface/should.js +78 -0
  37. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/addChainableMethod.js +111 -0
  38. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/addMethod.js +43 -0
  39. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/addProperty.js +40 -0
  40. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/flag.js +32 -0
  41. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/getActual.js +18 -0
  42. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/getEnumerableProperties.js +25 -0
  43. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/getMessage.js +49 -0
  44. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/getName.js +20 -0
  45. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/getPathValue.js +102 -0
  46. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/getProperties.js +35 -0
  47. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/index.js +114 -0
  48. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/inspect.js +320 -0
  49. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/objDisplay.js +49 -0
  50. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteChainableMethod.js +53 -0
  51. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteMethod.js +51 -0
  52. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteProperty.js +54 -0
  53. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/test.js +26 -0
  54. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/transferFlags.js +44 -0
  55. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai/utils/type.js +45 -0
  56. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/lib/chai.js +87 -0
  57. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/package.json +42 -0
  58. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/sauce.browsers.js +128 -0
  59. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_block.sh +7 -0
  60. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_setup.sh +53 -0
  61. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/assert.js +638 -0
  62. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/auth/.gitkeep +0 -0
  63. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/bootstrap/index.js +22 -0
  64. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/bootstrap/karma.js +22 -0
  65. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/configuration.js +133 -0
  66. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/display/errors.js +14 -0
  67. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/display/message.js +47 -0
  68. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/expect.js +814 -0
  69. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/globalShould.js +15 -0
  70. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/plugins.js +24 -0
  71. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/should.js +744 -0
  72. data/components/indefinido/indemma/master/components/chaijs/chai/1.9.1/test/utilities.js +309 -0
  73. data/components/indefinido/indemma/master/components/chaijs/deep-eql/0.1.3/component.json +20 -0
  74. data/components/indefinido/indemma/master/components/chaijs/deep-eql/0.1.3/lib/eql.js +257 -0
  75. data/components/indefinido/indemma/master/components/chaijs/type-detect/0.1.1/component.json +18 -0
  76. data/components/indefinido/indemma/master/components/chaijs/type-detect/0.1.1/lib/type.js +142 -0
  77. data/components/indefinido/indemma/master/components/component/bind/1.0.0/component.json +14 -0
  78. data/components/indefinido/indemma/master/components/component/bind/1.0.0/index.js +23 -0
  79. data/components/indefinido/indemma/master/components/component/jquery/1.0.0/component.json +10 -0
  80. data/components/indefinido/indemma/master/components/component/jquery/1.0.0/index.js +10308 -0
  81. data/components/indefinido/indemma/master/components/component/type/1.0.0/component.json +20 -0
  82. data/components/indefinido/indemma/master/components/component/type/1.0.0/index.js +32 -0
  83. data/components/indefinido/indemma/master/components/indefinido/advisable/master/component.json +21 -0
  84. data/components/indefinido/indemma/master/components/indefinido/advisable/master/index.js +1 -0
  85. data/components/indefinido/indemma/master/components/indefinido/advisable/master/lib/advisable.js +60 -0
  86. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/component.json +39 -0
  87. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/index.js +1 -0
  88. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/lib/adapters/rivets.js +40 -0
  89. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/lib/legacy/notifierable.js +145 -0
  90. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/lib/legacy/schedulerable.js +147 -0
  91. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/lib/lookup.js +38 -0
  92. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/lib/observable/keypath_observer.js +38 -0
  93. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/lib/observable/observation.js +45 -0
  94. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/lib/observable/selection.js +57 -0
  95. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/lib/observable/self_observer.js +38 -0
  96. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/lib/observable.js +97 -0
  97. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/lib/platform.js +12 -0
  98. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/vendor/observe-js/observe.js +1631 -0
  99. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/vendor/shims/accessors-legacy.js +92 -0
  100. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/vendor/shims/accessors.js +248 -0
  101. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/vendor/shims/array.indexOf.js +8 -0
  102. data/components/indefinido/indemma/master/components/indefinido/observable/es6-modules/vendor/shims/object.create.js +77 -0
  103. data/components/indefinido/indemma/master/components/pluma/assimilate/0.4.0/component.json +25 -0
  104. data/components/indefinido/indemma/master/components/pluma/assimilate/0.4.0/dist/assimilate.js +127 -0
  105. data/components/indefinido/indemma/master/karma.conf.js +75 -0
  106. data/components/indefinido/indemma/master/lib/record/associable.js +4 -2
  107. data/components/indefinido/indemma/master/lib/record/dirtyable.js +1 -1
  108. data/components/indefinido/indemma/master/package.json +9 -0
  109. data/components/indefinido/indemma/master/spec/record/associable_spec.js +211 -0
  110. data/components/indefinido/indemma/master/spec/record/dirtyable_spec.js +57 -0
  111. data/components/indefinido/indemma/master/spec/record/maid_spec.js +40 -0
  112. data/components/indefinido/indemma/master/spec/record/persistable_spec.js +46 -0
  113. data/components/indefinido/indemma/master/spec/record/queryable_spec.js +39 -0
  114. data/components/indefinido/indemma/master/spec/record/resource_spec.js +93 -0
  115. data/components/indefinido/indemma/master/spec/record/rest_spec.js +32 -0
  116. data/components/indefinido/indemma/master/spec/record/restfulable_spec.js +346 -0
  117. data/components/indefinido/indemma/master/spec/record/scopable_spec.js +242 -0
  118. data/components/indefinido/indemma/master/spec/record/storable_spec.js +44 -0
  119. data/components/indefinido/indemma/master/spec/record/translationable.js +28 -0
  120. data/components/indefinido/indemma/master/spec/record/validatable_spec.js +142 -0
  121. data/components/indefinido/indemma/master/spec/record/validations/associated_spec.js +43 -0
  122. data/components/indefinido/indemma/master/spec/record/validations/confirmation_spec.js +36 -0
  123. data/components/indefinido/indemma/master/spec/record/validations/cpf_spec.js +34 -0
  124. data/components/indefinido/indemma/master/spec/record/validations/presence_spec.js +28 -0
  125. data/components/indefinido/indemma/master/spec/record/validations/remote_spec.js +87 -0
  126. data/components/indefinido/indemma/master/spec/record/validations/type_spec.js +48 -0
  127. data/components/indefinido/indemma/master/spec/record_spec.js +49 -0
  128. data/components/indefinido/indemma/master/spec/spec_helper.js +15 -0
  129. data/components/indefinido/indemma/master/spec/support/value_objects/phone.js +45 -0
  130. data/components/indefinido/indemma/master/src/lib/extensions/rivets.coffee +17 -0
  131. data/components/indefinido/indemma/master/src/lib/record/associable.coffee +419 -0
  132. data/components/indefinido/indemma/master/src/lib/record/dirtyable.coffee +47 -0
  133. data/components/indefinido/indemma/master/src/lib/record/errors.coffee +20 -0
  134. data/components/indefinido/indemma/master/src/lib/record/maid.coffee +16 -0
  135. data/components/indefinido/indemma/master/src/lib/record/persistable.coffee +34 -0
  136. data/components/indefinido/indemma/master/src/lib/record/queryable.coffee +29 -0
  137. data/components/indefinido/indemma/master/src/lib/record/resource.coffee +107 -0
  138. data/components/indefinido/indemma/master/src/lib/record/rest.coffee +34 -0
  139. data/components/indefinido/indemma/master/src/lib/record/restfulable.coffee +487 -0
  140. data/components/indefinido/indemma/master/src/lib/record/scopable.coffee +279 -0
  141. data/components/indefinido/indemma/master/src/lib/record/storable.coffee +49 -0
  142. data/components/indefinido/indemma/master/src/lib/record/translationable.coffee +18 -0
  143. data/components/indefinido/indemma/master/src/lib/record/validatable.coffee +241 -0
  144. data/components/indefinido/indemma/master/src/lib/record/validations/associated.coffee +34 -0
  145. data/components/indefinido/indemma/master/src/lib/record/validations/confirmation.coffee +17 -0
  146. data/components/indefinido/indemma/master/src/lib/record/validations/cpf.coffee +57 -0
  147. data/components/indefinido/indemma/master/src/lib/record/validations/presence.coffee +16 -0
  148. data/components/indefinido/indemma/master/src/lib/record/validations/remote.coffee +61 -0
  149. data/components/indefinido/indemma/master/src/lib/record/validations/type.coffee +31 -0
  150. data/components/indefinido/indemma/master/src/lib/record/validations/validatorable.coffee +5 -0
  151. data/components/indefinido/indemma/master/src/lib/record.coffee +143 -0
  152. data/components/indefinido/indemma/master/src/spec/record/associable_spec.coffee +205 -0
  153. data/components/indefinido/indemma/master/src/spec/record/dirtyable_spec.coffee +47 -0
  154. data/components/indefinido/indemma/master/src/spec/record/maid_spec.coffee +34 -0
  155. data/components/indefinido/indemma/master/src/spec/record/persistable_spec.coffee +39 -0
  156. data/components/indefinido/indemma/master/src/spec/record/queryable_spec.coffee +33 -0
  157. data/components/indefinido/indemma/master/src/spec/record/resource_spec.coffee +69 -0
  158. data/components/indefinido/indemma/master/src/spec/record/rest_spec.coffee +22 -0
  159. data/components/indefinido/indemma/master/src/spec/record/restfulable_spec.coffee +257 -0
  160. data/components/indefinido/indemma/master/src/spec/record/scopable_spec.coffee +227 -0
  161. data/components/indefinido/indemma/master/src/spec/record/storable_spec.coffee +39 -0
  162. data/components/indefinido/indemma/master/src/spec/record/translationable.coffee +19 -0
  163. data/components/indefinido/indemma/master/src/spec/record/validatable_spec.coffee +127 -0
  164. data/components/indefinido/indemma/master/src/spec/record/validations/associated_spec.coffee +35 -0
  165. data/components/indefinido/indemma/master/src/spec/record/validations/confirmation_spec.coffee +25 -0
  166. data/components/indefinido/indemma/master/src/spec/record/validations/cpf_spec.coffee +27 -0
  167. data/components/indefinido/indemma/master/src/spec/record/validations/presence_spec.coffee +24 -0
  168. data/components/indefinido/indemma/master/src/spec/record/validations/remote_spec.coffee +74 -0
  169. data/components/indefinido/indemma/master/src/spec/record/validations/type_spec.coffee +33 -0
  170. data/components/indefinido/indemma/master/src/spec/record_spec.coffee +29 -0
  171. data/components/indefinido/indemma/master/src/spec/spec_helper.coffee +11 -0
  172. data/components/indefinido/indemma/master/src/spec/support/value_objects/phone.coffee +30 -0
  173. data/components/indefinido/indemma/master/vendor/object/mixin.js +196 -0
  174. data/components/indefinido/indemma/master/vendor/spec/sinon/assert.js +199 -0
  175. data/components/indefinido/indemma/master/vendor/spec/sinon/behavior.js +334 -0
  176. data/components/indefinido/indemma/master/vendor/spec/sinon/call.js +205 -0
  177. data/components/indefinido/indemma/master/vendor/spec/sinon/collection.js +155 -0
  178. data/components/indefinido/indemma/master/vendor/spec/sinon/match.js +245 -0
  179. data/components/indefinido/indemma/master/vendor/spec/sinon/mock.js +451 -0
  180. data/components/indefinido/indemma/master/vendor/spec/sinon/sandbox.js +144 -0
  181. data/components/indefinido/indemma/master/vendor/spec/sinon/spy.js +413 -0
  182. data/components/indefinido/indemma/master/vendor/spec/sinon/stub.js +161 -0
  183. data/components/indefinido/indemma/master/vendor/spec/sinon/test.js +77 -0
  184. data/components/indefinido/indemma/master/vendor/spec/sinon/test_case.js +99 -0
  185. data/components/indefinido/indemma/master/vendor/spec/sinon/util/event.js +94 -0
  186. data/components/indefinido/indemma/master/vendor/spec/sinon/util/fake_server.js +212 -0
  187. data/components/indefinido/indemma/master/vendor/spec/sinon/util/fake_server_with_clock.js +83 -0
  188. data/components/indefinido/indemma/master/vendor/spec/sinon/util/fake_timers.js +405 -0
  189. data/components/indefinido/indemma/master/vendor/spec/sinon/util/fake_xdomain_request.js +206 -0
  190. data/components/indefinido/indemma/master/vendor/spec/sinon/util/fake_xml_http_request.js +575 -0
  191. data/components/indefinido/indemma/master/vendor/spec/sinon/util/timers_ie.js +31 -0
  192. data/components/indefinido/indemma/master/vendor/spec/sinon/util/xdr_ie.js +14 -0
  193. data/components/indefinido/indemma/master/vendor/spec/sinon/util/xhr_ie.js +19 -0
  194. data/components/indefinido/indemma/master/vendor/spec/sinon.js +383 -0
  195. data/lib/assets/javascripts/value_objects/phone.js.coffee +3 -1
  196. data/lib/assets/javascripts/widgets/viewer/plugins/scopable.js.coffee +5 -5
  197. data/lib/ende/version.rb +1 -1
  198. data/vendor/assets/components/ende_build.css +4 -4
  199. data/vendor/assets/components/ende_build.js +7974 -7889
  200. metadata +191 -5
  201. data/vendor/assets/component/build.css +0 -112
  202. data/vendor/assets/components/build.css +0 -112
  203. data/vendor/assets/components/indemma_with_none.js +0 -30553
@@ -0,0 +1,1056 @@
1
+ /*!
2
+ * chai
3
+ * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
4
+ * MIT Licensed
5
+ */
6
+
7
+
8
+ module.exports = function (chai, util) {
9
+
10
+ /*!
11
+ * Chai dependencies.
12
+ */
13
+
14
+ var Assertion = chai.Assertion
15
+ , flag = util.flag;
16
+
17
+ /*!
18
+ * Module export.
19
+ */
20
+
21
+ /**
22
+ * ### assert(expression, message)
23
+ *
24
+ * Write your own test expressions.
25
+ *
26
+ * assert('foo' !== 'bar', 'foo is not bar');
27
+ * assert(Array.isArray([]), 'empty arrays are arrays');
28
+ *
29
+ * @param {Mixed} expression to test for truthiness
30
+ * @param {String} message to display on error
31
+ * @name assert
32
+ * @api public
33
+ */
34
+
35
+ var assert = chai.assert = function (express, errmsg) {
36
+ var test = new Assertion(null, null, chai.assert);
37
+ test.assert(
38
+ express
39
+ , errmsg
40
+ , '[ negation message unavailable ]'
41
+ );
42
+ };
43
+
44
+ /**
45
+ * ### .fail(actual, expected, [message], [operator])
46
+ *
47
+ * Throw a failure. Node.js `assert` module-compatible.
48
+ *
49
+ * @name fail
50
+ * @param {Mixed} actual
51
+ * @param {Mixed} expected
52
+ * @param {String} message
53
+ * @param {String} operator
54
+ * @api public
55
+ */
56
+
57
+ assert.fail = function (actual, expected, message, operator) {
58
+ message = message || 'assert.fail()';
59
+ throw new chai.AssertionError(message, {
60
+ actual: actual
61
+ , expected: expected
62
+ , operator: operator
63
+ }, assert.fail);
64
+ };
65
+
66
+ /**
67
+ * ### .ok(object, [message])
68
+ *
69
+ * Asserts that `object` is truthy.
70
+ *
71
+ * assert.ok('everything', 'everything is ok');
72
+ * assert.ok(false, 'this will fail');
73
+ *
74
+ * @name ok
75
+ * @param {Mixed} object to test
76
+ * @param {String} message
77
+ * @api public
78
+ */
79
+
80
+ assert.ok = function (val, msg) {
81
+ new Assertion(val, msg).is.ok;
82
+ };
83
+
84
+ /**
85
+ * ### .notOk(object, [message])
86
+ *
87
+ * Asserts that `object` is falsy.
88
+ *
89
+ * assert.notOk('everything', 'this will fail');
90
+ * assert.notOk(false, 'this will pass');
91
+ *
92
+ * @name notOk
93
+ * @param {Mixed} object to test
94
+ * @param {String} message
95
+ * @api public
96
+ */
97
+
98
+ assert.notOk = function (val, msg) {
99
+ new Assertion(val, msg).is.not.ok;
100
+ };
101
+
102
+ /**
103
+ * ### .equal(actual, expected, [message])
104
+ *
105
+ * Asserts non-strict equality (`==`) of `actual` and `expected`.
106
+ *
107
+ * assert.equal(3, '3', '== coerces values to strings');
108
+ *
109
+ * @name equal
110
+ * @param {Mixed} actual
111
+ * @param {Mixed} expected
112
+ * @param {String} message
113
+ * @api public
114
+ */
115
+
116
+ assert.equal = function (act, exp, msg) {
117
+ var test = new Assertion(act, msg, assert.equal);
118
+
119
+ test.assert(
120
+ exp == flag(test, 'object')
121
+ , 'expected #{this} to equal #{exp}'
122
+ , 'expected #{this} to not equal #{act}'
123
+ , exp
124
+ , act
125
+ );
126
+ };
127
+
128
+ /**
129
+ * ### .notEqual(actual, expected, [message])
130
+ *
131
+ * Asserts non-strict inequality (`!=`) of `actual` and `expected`.
132
+ *
133
+ * assert.notEqual(3, 4, 'these numbers are not equal');
134
+ *
135
+ * @name notEqual
136
+ * @param {Mixed} actual
137
+ * @param {Mixed} expected
138
+ * @param {String} message
139
+ * @api public
140
+ */
141
+
142
+ assert.notEqual = function (act, exp, msg) {
143
+ var test = new Assertion(act, msg, assert.notEqual);
144
+
145
+ test.assert(
146
+ exp != flag(test, 'object')
147
+ , 'expected #{this} to not equal #{exp}'
148
+ , 'expected #{this} to equal #{act}'
149
+ , exp
150
+ , act
151
+ );
152
+ };
153
+
154
+ /**
155
+ * ### .strictEqual(actual, expected, [message])
156
+ *
157
+ * Asserts strict equality (`===`) of `actual` and `expected`.
158
+ *
159
+ * assert.strictEqual(true, true, 'these booleans are strictly equal');
160
+ *
161
+ * @name strictEqual
162
+ * @param {Mixed} actual
163
+ * @param {Mixed} expected
164
+ * @param {String} message
165
+ * @api public
166
+ */
167
+
168
+ assert.strictEqual = function (act, exp, msg) {
169
+ new Assertion(act, msg).to.equal(exp);
170
+ };
171
+
172
+ /**
173
+ * ### .notStrictEqual(actual, expected, [message])
174
+ *
175
+ * Asserts strict inequality (`!==`) of `actual` and `expected`.
176
+ *
177
+ * assert.notStrictEqual(3, '3', 'no coercion for strict equality');
178
+ *
179
+ * @name notStrictEqual
180
+ * @param {Mixed} actual
181
+ * @param {Mixed} expected
182
+ * @param {String} message
183
+ * @api public
184
+ */
185
+
186
+ assert.notStrictEqual = function (act, exp, msg) {
187
+ new Assertion(act, msg).to.not.equal(exp);
188
+ };
189
+
190
+ /**
191
+ * ### .deepEqual(actual, expected, [message])
192
+ *
193
+ * Asserts that `actual` is deeply equal to `expected`.
194
+ *
195
+ * assert.deepEqual({ tea: 'green' }, { tea: 'green' });
196
+ *
197
+ * @name deepEqual
198
+ * @param {Mixed} actual
199
+ * @param {Mixed} expected
200
+ * @param {String} message
201
+ * @api public
202
+ */
203
+
204
+ assert.deepEqual = function (act, exp, msg) {
205
+ new Assertion(act, msg).to.eql(exp);
206
+ };
207
+
208
+ /**
209
+ * ### .notDeepEqual(actual, expected, [message])
210
+ *
211
+ * Assert that `actual` is not deeply equal to `expected`.
212
+ *
213
+ * assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' });
214
+ *
215
+ * @name notDeepEqual
216
+ * @param {Mixed} actual
217
+ * @param {Mixed} expected
218
+ * @param {String} message
219
+ * @api public
220
+ */
221
+
222
+ assert.notDeepEqual = function (act, exp, msg) {
223
+ new Assertion(act, msg).to.not.eql(exp);
224
+ };
225
+
226
+ /**
227
+ * ### .isTrue(value, [message])
228
+ *
229
+ * Asserts that `value` is true.
230
+ *
231
+ * var teaServed = true;
232
+ * assert.isTrue(teaServed, 'the tea has been served');
233
+ *
234
+ * @name isTrue
235
+ * @param {Mixed} value
236
+ * @param {String} message
237
+ * @api public
238
+ */
239
+
240
+ assert.isTrue = function (val, msg) {
241
+ new Assertion(val, msg).is['true'];
242
+ };
243
+
244
+ /**
245
+ * ### .isFalse(value, [message])
246
+ *
247
+ * Asserts that `value` is false.
248
+ *
249
+ * var teaServed = false;
250
+ * assert.isFalse(teaServed, 'no tea yet? hmm...');
251
+ *
252
+ * @name isFalse
253
+ * @param {Mixed} value
254
+ * @param {String} message
255
+ * @api public
256
+ */
257
+
258
+ assert.isFalse = function (val, msg) {
259
+ new Assertion(val, msg).is['false'];
260
+ };
261
+
262
+ /**
263
+ * ### .isNull(value, [message])
264
+ *
265
+ * Asserts that `value` is null.
266
+ *
267
+ * assert.isNull(err, 'there was no error');
268
+ *
269
+ * @name isNull
270
+ * @param {Mixed} value
271
+ * @param {String} message
272
+ * @api public
273
+ */
274
+
275
+ assert.isNull = function (val, msg) {
276
+ new Assertion(val, msg).to.equal(null);
277
+ };
278
+
279
+ /**
280
+ * ### .isNotNull(value, [message])
281
+ *
282
+ * Asserts that `value` is not null.
283
+ *
284
+ * var tea = 'tasty chai';
285
+ * assert.isNotNull(tea, 'great, time for tea!');
286
+ *
287
+ * @name isNotNull
288
+ * @param {Mixed} value
289
+ * @param {String} message
290
+ * @api public
291
+ */
292
+
293
+ assert.isNotNull = function (val, msg) {
294
+ new Assertion(val, msg).to.not.equal(null);
295
+ };
296
+
297
+ /**
298
+ * ### .isUndefined(value, [message])
299
+ *
300
+ * Asserts that `value` is `undefined`.
301
+ *
302
+ * var tea;
303
+ * assert.isUndefined(tea, 'no tea defined');
304
+ *
305
+ * @name isUndefined
306
+ * @param {Mixed} value
307
+ * @param {String} message
308
+ * @api public
309
+ */
310
+
311
+ assert.isUndefined = function (val, msg) {
312
+ new Assertion(val, msg).to.equal(undefined);
313
+ };
314
+
315
+ /**
316
+ * ### .isDefined(value, [message])
317
+ *
318
+ * Asserts that `value` is not `undefined`.
319
+ *
320
+ * var tea = 'cup of chai';
321
+ * assert.isDefined(tea, 'tea has been defined');
322
+ *
323
+ * @name isDefined
324
+ * @param {Mixed} value
325
+ * @param {String} message
326
+ * @api public
327
+ */
328
+
329
+ assert.isDefined = function (val, msg) {
330
+ new Assertion(val, msg).to.not.equal(undefined);
331
+ };
332
+
333
+ /**
334
+ * ### .isFunction(value, [message])
335
+ *
336
+ * Asserts that `value` is a function.
337
+ *
338
+ * function serveTea() { return 'cup of tea'; };
339
+ * assert.isFunction(serveTea, 'great, we can have tea now');
340
+ *
341
+ * @name isFunction
342
+ * @param {Mixed} value
343
+ * @param {String} message
344
+ * @api public
345
+ */
346
+
347
+ assert.isFunction = function (val, msg) {
348
+ new Assertion(val, msg).to.be.a('function');
349
+ };
350
+
351
+ /**
352
+ * ### .isNotFunction(value, [message])
353
+ *
354
+ * Asserts that `value` is _not_ a function.
355
+ *
356
+ * var serveTea = [ 'heat', 'pour', 'sip' ];
357
+ * assert.isNotFunction(serveTea, 'great, we have listed the steps');
358
+ *
359
+ * @name isNotFunction
360
+ * @param {Mixed} value
361
+ * @param {String} message
362
+ * @api public
363
+ */
364
+
365
+ assert.isNotFunction = function (val, msg) {
366
+ new Assertion(val, msg).to.not.be.a('function');
367
+ };
368
+
369
+ /**
370
+ * ### .isObject(value, [message])
371
+ *
372
+ * Asserts that `value` is an object (as revealed by
373
+ * `Object.prototype.toString`).
374
+ *
375
+ * var selection = { name: 'Chai', serve: 'with spices' };
376
+ * assert.isObject(selection, 'tea selection is an object');
377
+ *
378
+ * @name isObject
379
+ * @param {Mixed} value
380
+ * @param {String} message
381
+ * @api public
382
+ */
383
+
384
+ assert.isObject = function (val, msg) {
385
+ new Assertion(val, msg).to.be.a('object');
386
+ };
387
+
388
+ /**
389
+ * ### .isNotObject(value, [message])
390
+ *
391
+ * Asserts that `value` is _not_ an object.
392
+ *
393
+ * var selection = 'chai'
394
+ * assert.isNotObject(selection, 'tea selection is not an object');
395
+ * assert.isNotObject(null, 'null is not an object');
396
+ *
397
+ * @name isNotObject
398
+ * @param {Mixed} value
399
+ * @param {String} message
400
+ * @api public
401
+ */
402
+
403
+ assert.isNotObject = function (val, msg) {
404
+ new Assertion(val, msg).to.not.be.a('object');
405
+ };
406
+
407
+ /**
408
+ * ### .isArray(value, [message])
409
+ *
410
+ * Asserts that `value` is an array.
411
+ *
412
+ * var menu = [ 'green', 'chai', 'oolong' ];
413
+ * assert.isArray(menu, 'what kind of tea do we want?');
414
+ *
415
+ * @name isArray
416
+ * @param {Mixed} value
417
+ * @param {String} message
418
+ * @api public
419
+ */
420
+
421
+ assert.isArray = function (val, msg) {
422
+ new Assertion(val, msg).to.be.an('array');
423
+ };
424
+
425
+ /**
426
+ * ### .isNotArray(value, [message])
427
+ *
428
+ * Asserts that `value` is _not_ an array.
429
+ *
430
+ * var menu = 'green|chai|oolong';
431
+ * assert.isNotArray(menu, 'what kind of tea do we want?');
432
+ *
433
+ * @name isNotArray
434
+ * @param {Mixed} value
435
+ * @param {String} message
436
+ * @api public
437
+ */
438
+
439
+ assert.isNotArray = function (val, msg) {
440
+ new Assertion(val, msg).to.not.be.an('array');
441
+ };
442
+
443
+ /**
444
+ * ### .isString(value, [message])
445
+ *
446
+ * Asserts that `value` is a string.
447
+ *
448
+ * var teaOrder = 'chai';
449
+ * assert.isString(teaOrder, 'order placed');
450
+ *
451
+ * @name isString
452
+ * @param {Mixed} value
453
+ * @param {String} message
454
+ * @api public
455
+ */
456
+
457
+ assert.isString = function (val, msg) {
458
+ new Assertion(val, msg).to.be.a('string');
459
+ };
460
+
461
+ /**
462
+ * ### .isNotString(value, [message])
463
+ *
464
+ * Asserts that `value` is _not_ a string.
465
+ *
466
+ * var teaOrder = 4;
467
+ * assert.isNotString(teaOrder, 'order placed');
468
+ *
469
+ * @name isNotString
470
+ * @param {Mixed} value
471
+ * @param {String} message
472
+ * @api public
473
+ */
474
+
475
+ assert.isNotString = function (val, msg) {
476
+ new Assertion(val, msg).to.not.be.a('string');
477
+ };
478
+
479
+ /**
480
+ * ### .isNumber(value, [message])
481
+ *
482
+ * Asserts that `value` is a number.
483
+ *
484
+ * var cups = 2;
485
+ * assert.isNumber(cups, 'how many cups');
486
+ *
487
+ * @name isNumber
488
+ * @param {Number} value
489
+ * @param {String} message
490
+ * @api public
491
+ */
492
+
493
+ assert.isNumber = function (val, msg) {
494
+ new Assertion(val, msg).to.be.a('number');
495
+ };
496
+
497
+ /**
498
+ * ### .isNotNumber(value, [message])
499
+ *
500
+ * Asserts that `value` is _not_ a number.
501
+ *
502
+ * var cups = '2 cups please';
503
+ * assert.isNotNumber(cups, 'how many cups');
504
+ *
505
+ * @name isNotNumber
506
+ * @param {Mixed} value
507
+ * @param {String} message
508
+ * @api public
509
+ */
510
+
511
+ assert.isNotNumber = function (val, msg) {
512
+ new Assertion(val, msg).to.not.be.a('number');
513
+ };
514
+
515
+ /**
516
+ * ### .isBoolean(value, [message])
517
+ *
518
+ * Asserts that `value` is a boolean.
519
+ *
520
+ * var teaReady = true
521
+ * , teaServed = false;
522
+ *
523
+ * assert.isBoolean(teaReady, 'is the tea ready');
524
+ * assert.isBoolean(teaServed, 'has tea been served');
525
+ *
526
+ * @name isBoolean
527
+ * @param {Mixed} value
528
+ * @param {String} message
529
+ * @api public
530
+ */
531
+
532
+ assert.isBoolean = function (val, msg) {
533
+ new Assertion(val, msg).to.be.a('boolean');
534
+ };
535
+
536
+ /**
537
+ * ### .isNotBoolean(value, [message])
538
+ *
539
+ * Asserts that `value` is _not_ a boolean.
540
+ *
541
+ * var teaReady = 'yep'
542
+ * , teaServed = 'nope';
543
+ *
544
+ * assert.isNotBoolean(teaReady, 'is the tea ready');
545
+ * assert.isNotBoolean(teaServed, 'has tea been served');
546
+ *
547
+ * @name isNotBoolean
548
+ * @param {Mixed} value
549
+ * @param {String} message
550
+ * @api public
551
+ */
552
+
553
+ assert.isNotBoolean = function (val, msg) {
554
+ new Assertion(val, msg).to.not.be.a('boolean');
555
+ };
556
+
557
+ /**
558
+ * ### .typeOf(value, name, [message])
559
+ *
560
+ * Asserts that `value`'s type is `name`, as determined by
561
+ * `Object.prototype.toString`.
562
+ *
563
+ * assert.typeOf({ tea: 'chai' }, 'object', 'we have an object');
564
+ * assert.typeOf(['chai', 'jasmine'], 'array', 'we have an array');
565
+ * assert.typeOf('tea', 'string', 'we have a string');
566
+ * assert.typeOf(/tea/, 'regexp', 'we have a regular expression');
567
+ * assert.typeOf(null, 'null', 'we have a null');
568
+ * assert.typeOf(undefined, 'undefined', 'we have an undefined');
569
+ *
570
+ * @name typeOf
571
+ * @param {Mixed} value
572
+ * @param {String} name
573
+ * @param {String} message
574
+ * @api public
575
+ */
576
+
577
+ assert.typeOf = function (val, type, msg) {
578
+ new Assertion(val, msg).to.be.a(type);
579
+ };
580
+
581
+ /**
582
+ * ### .notTypeOf(value, name, [message])
583
+ *
584
+ * Asserts that `value`'s type is _not_ `name`, as determined by
585
+ * `Object.prototype.toString`.
586
+ *
587
+ * assert.notTypeOf('tea', 'number', 'strings are not numbers');
588
+ *
589
+ * @name notTypeOf
590
+ * @param {Mixed} value
591
+ * @param {String} typeof name
592
+ * @param {String} message
593
+ * @api public
594
+ */
595
+
596
+ assert.notTypeOf = function (val, type, msg) {
597
+ new Assertion(val, msg).to.not.be.a(type);
598
+ };
599
+
600
+ /**
601
+ * ### .instanceOf(object, constructor, [message])
602
+ *
603
+ * Asserts that `value` is an instance of `constructor`.
604
+ *
605
+ * var Tea = function (name) { this.name = name; }
606
+ * , chai = new Tea('chai');
607
+ *
608
+ * assert.instanceOf(chai, Tea, 'chai is an instance of tea');
609
+ *
610
+ * @name instanceOf
611
+ * @param {Object} object
612
+ * @param {Constructor} constructor
613
+ * @param {String} message
614
+ * @api public
615
+ */
616
+
617
+ assert.instanceOf = function (val, type, msg) {
618
+ new Assertion(val, msg).to.be.instanceOf(type);
619
+ };
620
+
621
+ /**
622
+ * ### .notInstanceOf(object, constructor, [message])
623
+ *
624
+ * Asserts `value` is not an instance of `constructor`.
625
+ *
626
+ * var Tea = function (name) { this.name = name; }
627
+ * , chai = new String('chai');
628
+ *
629
+ * assert.notInstanceOf(chai, Tea, 'chai is not an instance of tea');
630
+ *
631
+ * @name notInstanceOf
632
+ * @param {Object} object
633
+ * @param {Constructor} constructor
634
+ * @param {String} message
635
+ * @api public
636
+ */
637
+
638
+ assert.notInstanceOf = function (val, type, msg) {
639
+ new Assertion(val, msg).to.not.be.instanceOf(type);
640
+ };
641
+
642
+ /**
643
+ * ### .include(haystack, needle, [message])
644
+ *
645
+ * Asserts that `haystack` includes `needle`. Works
646
+ * for strings and arrays.
647
+ *
648
+ * assert.include('foobar', 'bar', 'foobar contains string "bar"');
649
+ * assert.include([ 1, 2, 3 ], 3, 'array contains value');
650
+ *
651
+ * @name include
652
+ * @param {Array|String} haystack
653
+ * @param {Mixed} needle
654
+ * @param {String} message
655
+ * @api public
656
+ */
657
+
658
+ assert.include = function (exp, inc, msg) {
659
+ new Assertion(exp, msg, assert.include).include(inc);
660
+ };
661
+
662
+ /**
663
+ * ### .notInclude(haystack, needle, [message])
664
+ *
665
+ * Asserts that `haystack` does not include `needle`. Works
666
+ * for strings and arrays.
667
+ *i
668
+ * assert.notInclude('foobar', 'baz', 'string not include substring');
669
+ * assert.notInclude([ 1, 2, 3 ], 4, 'array not include contain value');
670
+ *
671
+ * @name notInclude
672
+ * @param {Array|String} haystack
673
+ * @param {Mixed} needle
674
+ * @param {String} message
675
+ * @api public
676
+ */
677
+
678
+ assert.notInclude = function (exp, inc, msg) {
679
+ new Assertion(exp, msg, assert.notInclude).not.include(inc);
680
+ };
681
+
682
+ /**
683
+ * ### .match(value, regexp, [message])
684
+ *
685
+ * Asserts that `value` matches the regular expression `regexp`.
686
+ *
687
+ * assert.match('foobar', /^foo/, 'regexp matches');
688
+ *
689
+ * @name match
690
+ * @param {Mixed} value
691
+ * @param {RegExp} regexp
692
+ * @param {String} message
693
+ * @api public
694
+ */
695
+
696
+ assert.match = function (exp, re, msg) {
697
+ new Assertion(exp, msg).to.match(re);
698
+ };
699
+
700
+ /**
701
+ * ### .notMatch(value, regexp, [message])
702
+ *
703
+ * Asserts that `value` does not match the regular expression `regexp`.
704
+ *
705
+ * assert.notMatch('foobar', /^foo/, 'regexp does not match');
706
+ *
707
+ * @name notMatch
708
+ * @param {Mixed} value
709
+ * @param {RegExp} regexp
710
+ * @param {String} message
711
+ * @api public
712
+ */
713
+
714
+ assert.notMatch = function (exp, re, msg) {
715
+ new Assertion(exp, msg).to.not.match(re);
716
+ };
717
+
718
+ /**
719
+ * ### .property(object, property, [message])
720
+ *
721
+ * Asserts that `object` has a property named by `property`.
722
+ *
723
+ * assert.property({ tea: { green: 'matcha' }}, 'tea');
724
+ *
725
+ * @name property
726
+ * @param {Object} object
727
+ * @param {String} property
728
+ * @param {String} message
729
+ * @api public
730
+ */
731
+
732
+ assert.property = function (obj, prop, msg) {
733
+ new Assertion(obj, msg).to.have.property(prop);
734
+ };
735
+
736
+ /**
737
+ * ### .notProperty(object, property, [message])
738
+ *
739
+ * Asserts that `object` does _not_ have a property named by `property`.
740
+ *
741
+ * assert.notProperty({ tea: { green: 'matcha' }}, 'coffee');
742
+ *
743
+ * @name notProperty
744
+ * @param {Object} object
745
+ * @param {String} property
746
+ * @param {String} message
747
+ * @api public
748
+ */
749
+
750
+ assert.notProperty = function (obj, prop, msg) {
751
+ new Assertion(obj, msg).to.not.have.property(prop);
752
+ };
753
+
754
+ /**
755
+ * ### .deepProperty(object, property, [message])
756
+ *
757
+ * Asserts that `object` has a property named by `property`, which can be a
758
+ * string using dot- and bracket-notation for deep reference.
759
+ *
760
+ * assert.deepProperty({ tea: { green: 'matcha' }}, 'tea.green');
761
+ *
762
+ * @name deepProperty
763
+ * @param {Object} object
764
+ * @param {String} property
765
+ * @param {String} message
766
+ * @api public
767
+ */
768
+
769
+ assert.deepProperty = function (obj, prop, msg) {
770
+ new Assertion(obj, msg).to.have.deep.property(prop);
771
+ };
772
+
773
+ /**
774
+ * ### .notDeepProperty(object, property, [message])
775
+ *
776
+ * Asserts that `object` does _not_ have a property named by `property`, which
777
+ * can be a string using dot- and bracket-notation for deep reference.
778
+ *
779
+ * assert.notDeepProperty({ tea: { green: 'matcha' }}, 'tea.oolong');
780
+ *
781
+ * @name notDeepProperty
782
+ * @param {Object} object
783
+ * @param {String} property
784
+ * @param {String} message
785
+ * @api public
786
+ */
787
+
788
+ assert.notDeepProperty = function (obj, prop, msg) {
789
+ new Assertion(obj, msg).to.not.have.deep.property(prop);
790
+ };
791
+
792
+ /**
793
+ * ### .propertyVal(object, property, value, [message])
794
+ *
795
+ * Asserts that `object` has a property named by `property` with value given
796
+ * by `value`.
797
+ *
798
+ * assert.propertyVal({ tea: 'is good' }, 'tea', 'is good');
799
+ *
800
+ * @name propertyVal
801
+ * @param {Object} object
802
+ * @param {String} property
803
+ * @param {Mixed} value
804
+ * @param {String} message
805
+ * @api public
806
+ */
807
+
808
+ assert.propertyVal = function (obj, prop, val, msg) {
809
+ new Assertion(obj, msg).to.have.property(prop, val);
810
+ };
811
+
812
+ /**
813
+ * ### .propertyNotVal(object, property, value, [message])
814
+ *
815
+ * Asserts that `object` has a property named by `property`, but with a value
816
+ * different from that given by `value`.
817
+ *
818
+ * assert.propertyNotVal({ tea: 'is good' }, 'tea', 'is bad');
819
+ *
820
+ * @name propertyNotVal
821
+ * @param {Object} object
822
+ * @param {String} property
823
+ * @param {Mixed} value
824
+ * @param {String} message
825
+ * @api public
826
+ */
827
+
828
+ assert.propertyNotVal = function (obj, prop, val, msg) {
829
+ new Assertion(obj, msg).to.not.have.property(prop, val);
830
+ };
831
+
832
+ /**
833
+ * ### .deepPropertyVal(object, property, value, [message])
834
+ *
835
+ * Asserts that `object` has a property named by `property` with value given
836
+ * by `value`. `property` can use dot- and bracket-notation for deep
837
+ * reference.
838
+ *
839
+ * assert.deepPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'matcha');
840
+ *
841
+ * @name deepPropertyVal
842
+ * @param {Object} object
843
+ * @param {String} property
844
+ * @param {Mixed} value
845
+ * @param {String} message
846
+ * @api public
847
+ */
848
+
849
+ assert.deepPropertyVal = function (obj, prop, val, msg) {
850
+ new Assertion(obj, msg).to.have.deep.property(prop, val);
851
+ };
852
+
853
+ /**
854
+ * ### .deepPropertyNotVal(object, property, value, [message])
855
+ *
856
+ * Asserts that `object` has a property named by `property`, but with a value
857
+ * different from that given by `value`. `property` can use dot- and
858
+ * bracket-notation for deep reference.
859
+ *
860
+ * assert.deepPropertyNotVal({ tea: { green: 'matcha' }}, 'tea.green', 'konacha');
861
+ *
862
+ * @name deepPropertyNotVal
863
+ * @param {Object} object
864
+ * @param {String} property
865
+ * @param {Mixed} value
866
+ * @param {String} message
867
+ * @api public
868
+ */
869
+
870
+ assert.deepPropertyNotVal = function (obj, prop, val, msg) {
871
+ new Assertion(obj, msg).to.not.have.deep.property(prop, val);
872
+ };
873
+
874
+ /**
875
+ * ### .lengthOf(object, length, [message])
876
+ *
877
+ * Asserts that `object` has a `length` property with the expected value.
878
+ *
879
+ * assert.lengthOf([1,2,3], 3, 'array has length of 3');
880
+ * assert.lengthOf('foobar', 5, 'string has length of 6');
881
+ *
882
+ * @name lengthOf
883
+ * @param {Mixed} object
884
+ * @param {Number} length
885
+ * @param {String} message
886
+ * @api public
887
+ */
888
+
889
+ assert.lengthOf = function (exp, len, msg) {
890
+ new Assertion(exp, msg).to.have.length(len);
891
+ };
892
+
893
+ /**
894
+ * ### .throws(function, [constructor/string/regexp], [string/regexp], [message])
895
+ *
896
+ * Asserts that `function` will throw an error that is an instance of
897
+ * `constructor`, or alternately that it will throw an error with message
898
+ * matching `regexp`.
899
+ *
900
+ * assert.throw(fn, 'function throws a reference error');
901
+ * assert.throw(fn, /function throws a reference error/);
902
+ * assert.throw(fn, ReferenceError);
903
+ * assert.throw(fn, ReferenceError, 'function throws a reference error');
904
+ * assert.throw(fn, ReferenceError, /function throws a reference error/);
905
+ *
906
+ * @name throws
907
+ * @alias throw
908
+ * @alias Throw
909
+ * @param {Function} function
910
+ * @param {ErrorConstructor} constructor
911
+ * @param {RegExp} regexp
912
+ * @param {String} message
913
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
914
+ * @api public
915
+ */
916
+
917
+ assert.Throw = function (fn, errt, errs, msg) {
918
+ if ('string' === typeof errt || errt instanceof RegExp) {
919
+ errs = errt;
920
+ errt = null;
921
+ }
922
+
923
+ var assertErr = new Assertion(fn, msg).to.Throw(errt, errs);
924
+ return flag(assertErr, 'object');
925
+ };
926
+
927
+ /**
928
+ * ### .doesNotThrow(function, [constructor/regexp], [message])
929
+ *
930
+ * Asserts that `function` will _not_ throw an error that is an instance of
931
+ * `constructor`, or alternately that it will not throw an error with message
932
+ * matching `regexp`.
933
+ *
934
+ * assert.doesNotThrow(fn, Error, 'function does not throw');
935
+ *
936
+ * @name doesNotThrow
937
+ * @param {Function} function
938
+ * @param {ErrorConstructor} constructor
939
+ * @param {RegExp} regexp
940
+ * @param {String} message
941
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
942
+ * @api public
943
+ */
944
+
945
+ assert.doesNotThrow = function (fn, type, msg) {
946
+ if ('string' === typeof type) {
947
+ msg = type;
948
+ type = null;
949
+ }
950
+
951
+ new Assertion(fn, msg).to.not.Throw(type);
952
+ };
953
+
954
+ /**
955
+ * ### .operator(val1, operator, val2, [message])
956
+ *
957
+ * Compares two values using `operator`.
958
+ *
959
+ * assert.operator(1, '<', 2, 'everything is ok');
960
+ * assert.operator(1, '>', 2, 'this will fail');
961
+ *
962
+ * @name operator
963
+ * @param {Mixed} val1
964
+ * @param {String} operator
965
+ * @param {Mixed} val2
966
+ * @param {String} message
967
+ * @api public
968
+ */
969
+
970
+ assert.operator = function (val, operator, val2, msg) {
971
+ if (!~['==', '===', '>', '>=', '<', '<=', '!=', '!=='].indexOf(operator)) {
972
+ throw new Error('Invalid operator "' + operator + '"');
973
+ }
974
+ var test = new Assertion(eval(val + operator + val2), msg);
975
+ test.assert(
976
+ true === flag(test, 'object')
977
+ , 'expected ' + util.inspect(val) + ' to be ' + operator + ' ' + util.inspect(val2)
978
+ , 'expected ' + util.inspect(val) + ' to not be ' + operator + ' ' + util.inspect(val2) );
979
+ };
980
+
981
+ /**
982
+ * ### .closeTo(actual, expected, delta, [message])
983
+ *
984
+ * Asserts that the target is equal `expected`, to within a +/- `delta` range.
985
+ *
986
+ * assert.closeTo(1.5, 1, 0.5, 'numbers are close');
987
+ *
988
+ * @name closeTo
989
+ * @param {Number} actual
990
+ * @param {Number} expected
991
+ * @param {Number} delta
992
+ * @param {String} message
993
+ * @api public
994
+ */
995
+
996
+ assert.closeTo = function (act, exp, delta, msg) {
997
+ new Assertion(act, msg).to.be.closeTo(exp, delta);
998
+ };
999
+
1000
+ /**
1001
+ * ### .sameMembers(set1, set2, [message])
1002
+ *
1003
+ * Asserts that `set1` and `set2` have the same members.
1004
+ * Order is not taken into account.
1005
+ *
1006
+ * assert.sameMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'same members');
1007
+ *
1008
+ * @name sameMembers
1009
+ * @param {Array} superset
1010
+ * @param {Array} subset
1011
+ * @param {String} message
1012
+ * @api public
1013
+ */
1014
+
1015
+ assert.sameMembers = function (set1, set2, msg) {
1016
+ new Assertion(set1, msg).to.have.same.members(set2);
1017
+ }
1018
+
1019
+ /**
1020
+ * ### .includeMembers(superset, subset, [message])
1021
+ *
1022
+ * Asserts that `subset` is included in `superset`.
1023
+ * Order is not taken into account.
1024
+ *
1025
+ * assert.includeMembers([ 1, 2, 3 ], [ 2, 1 ], 'include members');
1026
+ *
1027
+ * @name includeMembers
1028
+ * @param {Array} superset
1029
+ * @param {Array} subset
1030
+ * @param {String} message
1031
+ * @api public
1032
+ */
1033
+
1034
+ assert.includeMembers = function (superset, subset, msg) {
1035
+ new Assertion(superset, msg).to.include.members(subset);
1036
+ }
1037
+
1038
+ /*!
1039
+ * Undocumented / untested
1040
+ */
1041
+
1042
+ assert.ifError = function (val, msg) {
1043
+ new Assertion(val, msg).to.not.be.ok;
1044
+ };
1045
+
1046
+ /*!
1047
+ * Aliases.
1048
+ */
1049
+
1050
+ (function alias(name, as){
1051
+ assert[as] = assert[name];
1052
+ return alias;
1053
+ })
1054
+ ('Throw', 'throw')
1055
+ ('Throw', 'throws');
1056
+ };