Changeset 516 for Dev/trunk/node_modules/should
- Timestamp:
- 03/14/14 12:36:58 (11 years ago)
- Location:
- Dev/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk
- Property svn:ignore
-
old new 1 1 build 2 quod-erat.git
-
- Property svn:ignore
-
Dev/trunk/node_modules/should/.idea/workspace.xml
r484 r516 5 5 <change type="MODIFICATION" beforePath="$PROJECT_DIR$/History.md" afterPath="$PROJECT_DIR$/History.md" /> 6 6 <change type="MODIFICATION" beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" /> 7 <change type="MODIFICATION" beforePath="$PROJECT_DIR$/should.js" afterPath="$PROJECT_DIR$/should.js" /> 7 8 </list> 8 9 <ignored path="should.js.iws" /> … … 39 40 <entry file="file://$PROJECT_DIR$/lib/should.js"> 40 41 <provider selected="true" editor-type-id="text-editor"> 41 <state line="2 7" column="84" selection-start="644" selection-end="644" vertical-scroll-proportion="0.0" vertical-offset="1045" max-vertical-offset="19019">42 <state line="29" column="88" selection-start="656" selection-end="656" vertical-scroll-proportion="-8.796296" vertical-offset="0" max-vertical-offset="19057"> 42 43 <folding /> 43 44 </state> … … 48 49 <entry file="file://$PROJECT_DIR$/Readme.md"> 49 50 <provider selected="true" editor-type-id="text-editor"> 50 <state line="4 19" column="0" selection-start="10358" selection-end="10358" vertical-scroll-proportion="0.0" vertical-offset="7961" max-vertical-offset="8702">51 <folding /> 52 </state> 53 </provider> 54 </entry> 55 </file> 56 <file leaf-file-name="package.json" pinned="false" current=" true" current-in-tab="true">51 <state line="420" column="0" selection-start="10380" selection-end="10380" vertical-scroll-proportion="0.0" vertical-offset="7980" max-vertical-offset="8702"> 52 <folding /> 53 </state> 54 </provider> 55 </entry> 56 </file> 57 <file leaf-file-name="package.json" pinned="false" current="false" current-in-tab="false"> 57 58 <entry file="file://$PROJECT_DIR$/package.json"> 58 59 <provider selected="true" editor-type-id="text-editor"> 59 <state line="2" column="21" selection-start="108" selection-end="108" vertical-scroll-proportion=" 0.0479798" vertical-offset="0" max-vertical-offset="792">60 <state line="2" column="21" selection-start="108" selection-end="108" vertical-scroll-proportion="-1.52" vertical-offset="0" max-vertical-offset="399"> 60 61 <folding /> 61 62 </state> … … 66 67 <entry file="file://$PROJECT_DIR$/test/should.test.js"> 67 68 <provider selected="true" editor-type-id="text-editor"> 68 <state line="913" column=" 62" selection-start="25161" selection-end="25161" vertical-scroll-proportion="0.0" vertical-offset="16720" max-vertical-offset="17537">69 <state line="913" column="59" selection-start="25150" selection-end="25150" vertical-scroll-proportion="0.0" vertical-offset="16720" max-vertical-offset="17537"> 69 70 <folding> 70 <marker date="138 4152632000" expanded="true" signature="24476:24735" placeholder="{...}" />71 <marker date="1386247488000" expanded="true" signature="24476:24735" placeholder="{...}" /> 71 72 </folding> 72 73 </state> … … 74 75 </entry> 75 76 </file> 76 <file leaf-file-name="History.md" pinned="false" current=" false" current-in-tab="false">77 <file leaf-file-name="History.md" pinned="false" current="true" current-in-tab="true"> 77 78 <entry file="file://$PROJECT_DIR$/History.md"> 78 79 <provider selected="true" editor-type-id="text-editor"> 79 <state line="3" column=" 60" selection-start="99" selection-end="99" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="3572">80 <state line="3" column="45" selection-start="84" selection-end="84" vertical-scroll-proportion="0.069767445" vertical-offset="0" max-vertical-offset="3667"> 80 81 <folding /> 81 82 </state> … … 131 132 <option value="$PROJECT_DIR$/lib/should.js" /> 132 133 <option value="$PROJECT_DIR$/test/should.test.js" /> 134 <option value="$PROJECT_DIR$/package.json" /> 133 135 <option value="$PROJECT_DIR$/History.md" /> 134 <option value="$PROJECT_DIR$/package.json" />135 136 </list> 136 137 </option> … … 201 202 </PATH_ELEMENT> 202 203 </PATH> 204 <PATH> 205 <PATH_ELEMENT> 206 <option name="myItemId" value="should.js" /> 207 <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> 208 </PATH_ELEMENT> 209 <PATH_ELEMENT> 210 <option name="myItemId" value="should.js" /> 211 <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> 212 </PATH_ELEMENT> 213 <PATH_ELEMENT> 214 <option name="myItemId" value="lib" /> 215 <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> 216 </PATH_ELEMENT> 217 </PATH> 203 218 </subPane> 204 219 </pane> … … 212 227 <property name="FullScreen" value="false" /> 213 228 <property name="DefaultHtmlFileTemplate" value="Html5" /> 229 <property name="options.splitter.details.proportions" value="0.2" /> 214 230 <property name="options.searchVisible" value="true" /> 215 <property name="options.splitter.details.proportions" value="0.2" />216 231 </component> 217 232 <component name="RunManager"> 218 <configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">219 <option name="VMOptions" />220 <option name="arguments" />221 <option name="filePath" />222 <option name="scope" value="ALL" />223 <option name="testName" />224 <method />225 </configuration>226 233 <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application"> 227 234 <option name="VMOptions" /> … … 232 239 <option name="showConsoleOnStdErr" value="false" /> 233 240 <option name="showConsoleOnStdOut" value="false" /> 241 <method /> 242 </configuration> 243 <configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit"> 244 <option name="VMOptions" /> 245 <option name="arguments" /> 246 <option name="filePath" /> 247 <option name="scope" value="ALL" /> 248 <option name="testName" /> 234 249 <method /> 235 250 </configuration> … … 354 369 <entry file="file://$PROJECT_DIR$/Readme.md"> 355 370 <provider selected="true" editor-type-id="text-editor"> 356 <state line="4 19" column="0" selection-start="10358" selection-end="10358" vertical-scroll-proportion="0.0" vertical-offset="7961" max-vertical-offset="8702">371 <state line="420" column="0" selection-start="10380" selection-end="10380" vertical-scroll-proportion="0.0" vertical-offset="7980" max-vertical-offset="8702"> 357 372 <folding /> 358 373 </state> … … 368 383 <entry file="file://$PROJECT_DIR$/.npmignore"> 369 384 <provider selected="true" editor-type-id="text-editor"> 370 <state line="1" column="4" selection-start="13" selection-end="13" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="105"> 371 <folding /> 385 <state line="1" column="4" selection-start="13" selection-end="13" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="105" /> 386 </provider> 387 </entry> 388 <entry file="file://$PROJECT_DIR$/lib/should.js"> 389 <provider selected="true" editor-type-id="text-editor"> 390 <state line="29" column="88" selection-start="656" selection-end="656" vertical-scroll-proportion="-8.796296" vertical-offset="0" max-vertical-offset="19057"> 391 <folding /> 392 </state> 393 </provider> 394 </entry> 395 <entry file="file://$PROJECT_DIR$/test/should.test.js"> 396 <provider selected="true" editor-type-id="text-editor"> 397 <state line="913" column="59" selection-start="25150" selection-end="25150" vertical-scroll-proportion="0.0" vertical-offset="16720" max-vertical-offset="17537"> 398 <folding> 399 <marker date="1386247488000" expanded="true" signature="24476:24735" placeholder="{...}" /> 400 </folding> 372 401 </state> 373 402 </provider> … … 375 404 <entry file="file://$PROJECT_DIR$/Makefile"> 376 405 <provider selected="true" editor-type-id="text-editor"> 377 <state line="6" column="5" selection-start="64" selection-end="64" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="210"> 378 <folding /> 379 </state> 380 </provider> 381 </entry> 382 <entry file="file://$PROJECT_DIR$/lib/should.js"> 383 <provider selected="true" editor-type-id="text-editor"> 384 <state line="27" column="84" selection-start="644" selection-end="644" vertical-scroll-proportion="0.0" vertical-offset="57" max-vertical-offset="19019"> 385 <folding /> 386 </state> 387 </provider> 388 </entry> 389 <entry file="file://$PROJECT_DIR$/test/should.test.js"> 390 <provider selected="true" editor-type-id="text-editor"> 391 <state line="913" column="62" selection-start="25161" selection-end="25161" vertical-scroll-proportion="0.0" vertical-offset="16720" max-vertical-offset="17537"> 392 <folding> 393 <marker date="1384152632000" expanded="true" signature="24476:24735" placeholder="{...}" /> 394 </folding> 406 <state line="6" column="5" selection-start="64" selection-end="64" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="266"> 407 <folding /> 408 </state> 409 </provider> 410 </entry> 411 <entry file="file://$PROJECT_DIR$/package.json"> 412 <provider selected="true" editor-type-id="text-editor"> 413 <state line="2" column="21" selection-start="108" selection-end="108" vertical-scroll-proportion="-1.52" vertical-offset="0" max-vertical-offset="399"> 414 <folding /> 395 415 </state> 396 416 </provider> … … 398 418 <entry file="file://$PROJECT_DIR$/History.md"> 399 419 <provider selected="true" editor-type-id="text-editor"> 400 <state line="3" column="60" selection-start="99" selection-end="99" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="3572"> 401 <folding /> 402 </state> 403 </provider> 404 </entry> 405 <entry file="file://$PROJECT_DIR$/package.json"> 406 <provider selected="true" editor-type-id="text-editor"> 407 <state line="2" column="21" selection-start="108" selection-end="108" vertical-scroll-proportion="0.0479798" vertical-offset="0" max-vertical-offset="792"> 420 <state line="3" column="45" selection-start="84" selection-end="84" vertical-scroll-proportion="0.069767445" vertical-offset="0" max-vertical-offset="3667"> 408 421 <folding /> 409 422 </state> -
Dev/trunk/node_modules/should/History.md
r484 r516 1 2.1.1 / 2013-12-05 2 ================== 3 4 * Move date formatting out of should.inspect 5 1 6 2.1.0 / 2013-11-11 2 7 ================== -
Dev/trunk/node_modules/should/Readme.md
r484 r516 223 223 ## property 224 224 225 Assert property exists and has optional value :225 Assert property exists and has optional value(compare using `===`): 226 226 ```javascript 227 227 user.should.have.property('name') -
Dev/trunk/node_modules/should/lib/should.js
r484 r516 25 25 }; 26 26 27 should.inspect = function(obj, opts) { 28 if(util.isDate(obj) && typeof obj.inspect !== 'function') obj = obj.toISOString(); 29 return inspect(obj, opts); 30 }; 27 should.inspect = inspect; 28 29 function i(value) { 30 if(util.isDate(value) && typeof value.inspect !== 'function') return value.toISOString(); //show millis in dates 31 return should.inspect(value); 32 } 31 33 32 34 /** … … 52 54 if(null == obj) { 53 55 throw new AssertionError({ 54 message: msg || ('expected ' + should.inspect(obj) + ' to exist')56 message: msg || ('expected ' + i(obj) + ' to exist') 55 57 , stackStartFunction: should.exist 56 58 }); … … 70 72 if (null != obj) { 71 73 throw new AssertionError({ 72 message: msg || ('expected ' + should.inspect(obj) + ' to not exist')74 message: msg || ('expected ' + i(obj) + ' to not exist') 73 75 , stackStartFunction: should.not.exist 74 76 }); … … 238 240 239 241 get inspect() { 240 return should.inspect(this.obj);242 return i(this.obj); 241 243 }, 242 244 … … 368 370 this.assert( 369 371 eql(val, this.obj) 370 , function(){ return 'expected ' + this.inspect + ' to equal ' + should.inspect(val) + (description ? " | " + description : "") }371 , function(){ return 'expected ' + this.inspect + ' to not equal ' + should.inspect(val) + (description ? " | " + description : "") }372 , function(){ return 'expected ' + this.inspect + ' to equal ' + i(val) + (description ? " | " + description : "") } 373 , function(){ return 'expected ' + this.inspect + ' to not equal ' + i(val) + (description ? " | " + description : "") } 372 374 , val 373 375 , true … … 387 389 this.assert( 388 390 val === this.obj 389 , function(){ return 'expected ' + this.inspect + ' to equal ' + should.inspect(val) + (description ? " | " + description : "") }390 , function(){ return 'expected ' + this.inspect + ' to not equal ' + should.inspect(val) + (description ? " | " + description : "") }391 , function(){ return 'expected ' + this.inspect + ' to equal ' + i(val) + (description ? " | " + description : "") } 392 , function(){ return 'expected ' + this.inspect + ' to not equal ' + i(val) + (description ? " | " + description : "") } 391 393 , val 392 394 , void 0 … … 640 642 if (this.negate && undefined !== val) { 641 643 if (undefined === this.obj[name]) { 642 throw new Error(this.inspect + ' has no property ' + should.inspect(name) + (description ? " | " + description : ""));644 throw new Error(this.inspect + ' has no property ' + i(name) + (description ? " | " + description : "")); 643 645 } 644 646 } else { 645 647 this.assert( 646 648 undefined !== this.obj[name] 647 , function(){ return 'expected ' + this.inspect + ' to have a property ' + should.inspect(name) + (description ? " | " + description : "") }648 , function(){ return 'expected ' + this.inspect + ' to not have a property ' + should.inspect(name) + (description ? " | " + description : "") }649 , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name) + (description ? " | " + description : "") } 650 , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + (description ? " | " + description : "") } 649 651 , void 0 650 652 , void 0 … … 655 657 this.assert( 656 658 val === this.obj[name] 657 , function(){ return 'expected ' + this.inspect + ' to have a property ' + should.inspect(name)658 + ' of ' + should.inspect(val) + ', but got ' + should.inspect(this.obj[name]) + (description ? " | " + description : "") }659 , function(){ return 'expected ' + this.inspect + ' to not have a property ' + should.inspect(name) + ' of ' + should.inspect(val) + (description ? " | " + description : "") }659 , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name) 660 + ' of ' + i(val) + ', but got ' + i(this.obj[name]) + (description ? " | " + description : "") } 661 , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + ' of ' + i(val) + (description ? " | " + description : "") } 660 662 , void 0 661 663 , void 0 … … 691 693 if (len > 1) { 692 694 names = names.map(function(name){ 693 return should.inspect(name);695 return i(name); 694 696 }); 695 697 var last = names.pop(); 696 698 str = names.join(', ') + ', and ' + last; 697 699 } else { 698 str = should.inspect(names[0]);700 str = i(names[0]); 699 701 } 700 702 … … 721 723 this.assert( 722 724 hasOwnProperty.call(this.obj, name) 723 , function(){ return 'expected ' + this.inspect + ' to have own property ' + should.inspect(name) + (description ? " | " + description : "") }724 , function(){ return 'expected ' + this.inspect + ' to not have own property ' + should.inspect(name) + (description ? " | " + description : "") }725 , function(){ return 'expected ' + this.inspect + ' to have own property ' + i(name) + (description ? " | " + description : "") } 726 , function(){ return 'expected ' + this.inspect + ' to not have own property ' + i(name) + (description ? " | " + description : "") } 725 727 , void 0 726 728 , void 0 … … 739 741 startWith: function(str, description) { 740 742 this.assert(0 === this.obj.indexOf(str) 741 , function() { return 'expected ' + this.inspect + ' to start with ' + should.inspect(str) + (description ? " | " + description : "") }742 , function() { return 'expected ' + this.inspect + ' to not start with ' + should.inspect(str) + (description ? " | " + description : "") }743 , function() { return 'expected ' + this.inspect + ' to start with ' + i(str) + (description ? " | " + description : "") } 744 , function() { return 'expected ' + this.inspect + ' to not start with ' + i(str) + (description ? " | " + description : "") } 743 745 , void 0 744 746 , void 0 … … 756 758 endWith: function(str, description) { 757 759 this.assert(-1 !== this.obj.indexOf(str, this.obj.length - str.length) 758 , function() { return 'expected ' + this.inspect + ' to end with ' + should.inspect(str) + (description ? " | " + description : "") }759 , function() { return 'expected ' + this.inspect + ' to not end with ' + should.inspect(str) + (description ? " | " + description : "") }760 , function() { return 'expected ' + this.inspect + ' to end with ' + i(str) + (description ? " | " + description : "") } 761 , function() { return 'expected ' + this.inspect + ' to not end with ' + i(str) + (description ? " | " + description : "") } 760 762 , void 0 761 763 , void 0 … … 778 780 this.assert( 779 781 eql(cmp, obj) 780 , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }781 , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }782 , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + i(obj) + (description ? " | " + description : "") } 783 , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + i(obj) + (description ? " | " + description : "") } 782 784 , void 0 783 785 , void 0 … … 786 788 this.assert( 787 789 ~this.obj.indexOf(obj) 788 , function(){ return 'expected ' + this.inspect + ' to include ' + should.inspect(obj) + (description ? " | " + description : "") }789 , function(){ return 'expected ' + this.inspect + ' to not include ' + should.inspect(obj) + (description ? " | " + description : "") }790 , function(){ return 'expected ' + this.inspect + ' to include ' + i(obj) + (description ? " | " + description : "") } 791 , function(){ return 'expected ' + this.inspect + ' to not include ' + i(obj) + (description ? " | " + description : "") } 790 792 , void 0 791 793 , void 0 … … 806 808 this.assert( 807 809 this.obj.some(function(item) { return eql(obj, item); }) 808 , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }809 , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }810 , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + i(obj) + (description ? " | " + description : "") } 811 , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + i(obj) + (description ? " | " + description : "") } 810 812 , void 0 811 813 , void 0 … … 846 848 if (len > 1) { 847 849 keys = keys.map(function(key){ 848 return should.inspect(key);850 return i(key); 849 851 }); 850 852 var last = keys.pop(); 851 853 str = keys.join(', ') + ', and ' + last; 852 854 } else { 853 str = should.inspect(keys[0]);855 str = i(keys[0]); 854 856 } 855 857 … … 895 897 this.assert( 896 898 code == status 897 , function(){ return 'expected response code of ' + code + ' ' + should.inspect(statusCodes[code])898 + ', but got ' + status + ' ' + should.inspect(statusCodes[status]) }899 , function(){ return 'expected to not respond with ' + code + ' ' + should.inspect(statusCodes[code]) });899 , function(){ return 'expected response code of ' + code + ' ' + i(statusCodes[code]) 900 + ', but got ' + status + ' ' + i(statusCodes[status]) } 901 , function(){ return 'expected to not respond with ' + code + ' ' + i(statusCodes[code]) }); 900 902 901 903 return this; -
Dev/trunk/node_modules/should/package.json
r484 r516 2 2 "name": "should", 3 3 "description": "test framework agnostic BDD-style assertions", 4 "version": "2.1. 0",4 "version": "2.1.1", 5 5 "author": { 6 6 "name": "TJ Holowaychuk", … … 33 33 "node": ">= 0.2.0" 34 34 }, 35 "readme": "# should.js\n\n_should_ is an expressive, readable, test framework agnostic, assertion library for [node](http://nodejs.org).\n\nIt extends the Object prototype with a single non-enumerable getter that allows you to express how that object should behave.\n\n## Example\n```javascript\nvar should = require('should');\n\nvar user = {\n name: 'tj'\n , pets: ['tobi', 'loki', 'jane', 'bandit']\n};\n\nuser.should.have.property('name', 'tj');\nuser.should.have.property('pets').with.lengthOf(4);\n\n// or without Object.prototype, for guys how did Object.create(null)\nshould(user).have.property('name', 'tj');\nshould(true).ok;\n\nsomeAsyncTask(foo, function(err, result){\n should.not.exist(err);\n should.exist(result);\n result.bar.should.equal(foo);\n});\n```\n## Installation\n\n $ npm install should --save-dev\n\n## In browser\n\nIf you want to use _should_ in browser, use version that is in root of repository. It is build with browserify (see [Makefile](https://github.com/visionmedia/should.js/blob/master/Makefile) about how it is build). To build fresh version:\n\n```bash\n# you should have browserify\nnpm install -g browserify\nmake browser\n```\n\n## chaining assertions\n\nEvery assertion will return a should.js-wraped Object, so assertions can be chained. For example:\n\n```js\nuser.should.be.an.instanceOf(Object).and.have.property('name', 'tj');\nuser.pets.should.be.instanceof(Array).and.have.lengthOf(4);\n```\n\nAll assertions return themselves but not `property` and `ownProperty`. They two would return the property value.\n\nfor example if a property is volatile we can first assert property existence:\n```javascript\n// `user.should.have.property('pets')` returned `should(user.pets)` but not `should(user)`\nuser.should.have.property('pets').with.lengthOf(4)\n```\nwhich is essentially equivalent to below, however the property may not exist:\n```javascript\nuser.pets.should.have.lengthOf(4)\n```\n\nour dummy getters such as _a_, _an_, _be_, _of_ and _have_ make tests more readable while the getters _and_ and _with_ helps express chaining:\n```javascript\nuser.should.be.an.instanceOf(Object).and.have.property('name', 'tj')\nuser.should.have.property('pets').with.a.lengthOf(4)\n```\nThose getters don't have any actual effect, just for readability.\n\n## static\n\nFor some rare cases should can be used statically, without `Object.prototype`.\nIt can be replacement for node assert module (and it uses the same `AssertionError`):\n\n```javascript\nassert.fail(actual, expected, message, operator) // just write wrong should assertion\nassert(value, message), assert.ok(value, [message]) // should(value).ok\nassert.equal(actual, expected, [message]) // should(actual).eql(expected, [message])\nassert.notEqual(actual, expected, [message]) // should(actual).not.eql(expected, [message])\nassert.deepEqual(actual, expected, [message]) // should(actual).eql(expected, [message])\nassert.notDeepEqual(actual, expected, [message]) // should(actual).not.eql(expected, [message])\nassert.strictEqual(actual, expected, [message]) // should(actual).equal(expected, [message])\nassert.notStrictEqual(actual, expected, [message]) // should(actual).not.equal(expected, [message])\nassert.throws(block, [error], [message]) // should(block).throw([error])\nassert.doesNotThrow(block, [message]) // should(block).not.throw([error])\nassert.ifError(value) // should(value).Error (to check if it is error) or should(value).not.ok (to check that it is falsy)\n```\n\n## ok\n\nAssert truthfulness:\n```javascript\ntrue.should.be.ok\n'yay'.should.be.ok\n(1).should.be.ok\n```\nor negated:\n```javascript\nfalse.should.not.be.ok\n''.should.not.be.ok\n(0).should.not.be.ok\n```\n## true\n\nAssert === true:\n```javascript\ntrue.should.be.true\n'1'.should.not.be.true\n```\n## false\n\nAssert === false:\n```javascript\nfalse.should.be.false\n(0).should.not.be.false\n```\n## arguments\n\nAssert `Arguments`:\n```javascript\nvar args = (function(){ return arguments; })(1,2,3);\nargs.should.be.arguments;\n[].should.not.be.arguments;\n```\n## empty\n\nAsserts that given object is empty\n```javascript\n[].should.be.empty\n''.should.be.empty\n({}).should.be.empty\n(function() {\n arguments.should.be.empty;\n})()\n```\n## eql\n\nequality:\n```javascript\n({ foo: 'bar' }).should.eql({ foo: 'bar' })\n[1,2,3].should.eql([1,2,3])\n```\n## equal and exactly\n\nstrict equality:\n```javascript\nshould.strictEqual(undefined, value)\nshould.strictEqual(false, value)\n(4).should.equal(4)\n'test'.should.equal('test')\n[1,2,3].should.not.equal([1,2,3])\n(4).should.be.exactly(4)\n```\n## within\n\nAssert inclusive numeric range:\n```javascript\nuser.age.should.be.within(5, 50)\n```\n## approximately\n\nAssert floating point number:\n```javascript\n(99.99).should.be.approximately(100, 0.1);\n```\n## type\n\nAssert __typeof__:\n```javascript\nuser.should.be.type('object')\n'test'.should.be.type('string')\n```\n## instanceof and instanceOf\n\nAssert __instanceof__ or __instanceOf__:\n```javascript\nuser.should.be.an.instanceof(User)\n[].should.be.an.instanceOf(Array)\n```\n## above\n\nAssert numeric value above the given value:\n```javascript\nuser.age.should.be.above(5)\nuser.age.should.not.be.above(100)\n```\n## below\n\nAssert numeric value below the given value:\n```javascript\nuser.age.should.be.below(100)\nuser.age.should.not.be.below(5)\n```\n## NaN\n\nAssert numeric valus is NaN:\n```javascript\n(undefined + 0).should.be.NaN;\n```\n## Infinity\n\nAssert numeric valus is Infinity:\n```javascript\n(1/0).should.be.Infinity;\n```\n## match\n\nAssert regexp match:\n```javascript\nusername.should.match(/^\\w+$/)\n```\n## length\n\nAssert _length_ property exists and has a value of the given number:\n```javascript\nuser.pets.should.have.length(5)\nuser.pets.should.have.a.lengthOf(5)\n({ length: 10}).should.have.length(10);\n```\nAliases: _lengthOf_\n\n## property\n\nAssert property exists and has optional value :\n```javascript\nuser.should.have.property('name')\nuser.should.have.property('age', 15)\nuser.should.not.have.property('rawr')\nuser.should.not.have.property('age', 0)\n```\n\n## properties\n\nAssert given properties exists:\n```javascript\nuser.should.have.properties('name', 'age');\nuser.should.have.properties(['name', 'age']);\n```\n## ownProperty\n\nAssert own property (on the immediate object):\n```javascript\n({ foo: 'bar' }).should.have.ownProperty('foo')\n```\n## status(code)\n\n Asserts that `.statusCode` is `code`:\n```javascript\nres.should.have.status(200);\n```\n## header(field[, value])\n\n Asserts that a `.headers` object with `field` and optional `value` are present:\n```javascript\nres.should.have.header('content-length');\nres.should.have.header('Content-Length', '123');\nres.should.have.header('content-length', '123');\n```\n## json\n\n Assert that Content-Type is \"application/json; charset=utf-8\"\n```javascript\nres.should.be.json\n```\n## html\n\n Assert that Content-Type is \"text/html; charset=utf-8\"\n```javascript\nres.should.be.html\n```\n\n## include(obj) or contain(obj)\n\nAssert that the given `obj` is present via `indexOf()`, so this works for strings, arrays, or custom objects implementing indexOf. Also it can assert if given object will have some sub-object.\n\nAssert array value:\n```javascript\n[1,2,3].should.include(3)\n[1,2,3].should.include(2)\n[1,2,3].should.not.include(4)\n```\nAssert substring:\n```javascript\n'foo bar baz'.should.include('foo')\n'foo bar baz'.should.include('bar')\n'foo bar baz'.should.include('baz')\n'foo bar baz'.should.not.include('FOO')\n```\nAssert object includes another object:\n```javascript\nvar tobi = { name: 'Tobi', age: 1 };\nvar jane = { name: 'Jane', age: 5 };\nvar user = { name: 'TJ', pet: tobi };\n\nuser.should.include({ pet: tobi });\nuser.should.include({ pet: tobi, name: 'TJ' });\nuser.should.not.include({ pet: jane });\nuser.should.not.include({ name: 'Someone' });\n```\n## includeEql(obj)\n\nAssert that an object equal to the given `obj` is present in an Array:\n```javascript\n[[1],[2],[3]].should.includeEql([3])\n[[1],[2],[3]].should.includeEql([2])\n[[1],[2],[3]].should.not.includeEql([4])\n```\n## throw()\n\nAssert an exception is thrown:\n\n```js\n(function(){\n throw new Error('fail');\n}).should.throw();\n```\n\nAssert an exception is not thrown:\n\n```js\n(function(){\n\n}).should.not.throw();\n```\nAssert exception message matches string:\n\n```js\n(function(){\n throw new Error('fail');\n}).should.throw('fail');\n```\n\nAssert exepection message matches regexp:\n\n```js\n(function(){\n throw new Error('failed to foo');\n}).should.throw(/^fail/);\n```\n\n## throwError()\n\nAn alias of `throw`, its purpose is to be an option for those who run\n[jshint](https://github.com/jshint/node-jshint/) in strict mode.\n\n```js\n(function(){\n throw new Error('failed to baz');\n}).should.throwError(/^fail.*/);\n```\n\n## startWith(str)\n\nAssert that string starts with `str`.\n\n```javascript\n'foobar'.should.startWith('foo')\n'foobar'.should.not.startWith('bar')\n```\n## endWith(str)\n\nAssert that string ends with `str`.\n\n```javascript\n'foobar'.should.endWith('bar')\n'foobar'.should.not.endWith('foo')\n```\n\n## keys\n\nAssert own object keys, which must match _exactly_,\nand will fail if you omit a key or two:\n\n var obj = { foo: 'bar', baz: 'raz' };\n obj.should.have.keys('foo', 'baz');\n obj.should.have.keys(['foo', 'baz']);\n\n## type assertions\n\n```javascript\n({}).should.be.an.Object;\n(1).should.be.an.Number;\n[].should.be.an.Array;\n(true).should.be.a.Boolean;\n''.should.be.a.String;\n```\n\n## Optional Error description\n\nAs it can often be difficult to ascertain exactly where failed assertions are coming from in your tests, an optional description parameter can be passed to several should matchers. The description will follow the failed assertion in the error:\n\n (1).should.eql(0, 'some useful description')\n\n AssertionError: expected 1 to equal 0 | some useful description\n at Object.eql (/Users/swift/code/should.js/node_modules/should/lib/should.js:280:10)\n ...\n\nThe methods that support this optional description are: `eql`, `equal`, `within`, `a`, `instanceof`, `above`, `below`, `match`, `length`, `property`, `ownProperty`, `include`, and `includeEql`.\n\n## Mocha example\n\nFor example you can use should with the [Mocha test framework](http://visionmedia.github.io/mocha/) by simply including it:\n\n```javascript\nvar should = require('should');\nvar mylib = require('mylib');\n\n\ndescribe('mylib', function () {\n it('should have a version with the format #.#.#', function() {\n lib.version.should.match(/^\\d+\\.\\d+\\.\\d+$/);\n }\n});\n```\n\n## Running tests\n\nTo run the tests for _should_ simply run:\n\n $ make test\n\n## OMG IT EXTENDS OBJECT???!?!@\n\nYes, yes it does, with a single getter _should_, and no it won't break your code, because it does this **properly** with a non-enumerable property.\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2010-2011 TJ Holowaychuk <tj@vision-media.ca>\n\nCopyright (c) 2011 Aseem Kishore <aseem.kishore@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",35 "readme": "# should.js\n\n_should_ is an expressive, readable, test framework agnostic, assertion library for [node](http://nodejs.org).\n\nIt extends the Object prototype with a single non-enumerable getter that allows you to express how that object should behave.\n\n## Example\n```javascript\nvar should = require('should');\n\nvar user = {\n name: 'tj'\n , pets: ['tobi', 'loki', 'jane', 'bandit']\n};\n\nuser.should.have.property('name', 'tj');\nuser.should.have.property('pets').with.lengthOf(4);\n\n// or without Object.prototype, for guys how did Object.create(null)\nshould(user).have.property('name', 'tj');\nshould(true).ok;\n\nsomeAsyncTask(foo, function(err, result){\n should.not.exist(err);\n should.exist(result);\n result.bar.should.equal(foo);\n});\n```\n## Installation\n\n $ npm install should --save-dev\n\n## In browser\n\nIf you want to use _should_ in browser, use version that is in root of repository. It is build with browserify (see [Makefile](https://github.com/visionmedia/should.js/blob/master/Makefile) about how it is build). To build fresh version:\n\n```bash\n# you should have browserify\nnpm install -g browserify\nmake browser\n```\n\n## chaining assertions\n\nEvery assertion will return a should.js-wraped Object, so assertions can be chained. For example:\n\n```js\nuser.should.be.an.instanceOf(Object).and.have.property('name', 'tj');\nuser.pets.should.be.instanceof(Array).and.have.lengthOf(4);\n```\n\nAll assertions return themselves but not `property` and `ownProperty`. They two would return the property value.\n\nfor example if a property is volatile we can first assert property existence:\n```javascript\n// `user.should.have.property('pets')` returned `should(user.pets)` but not `should(user)`\nuser.should.have.property('pets').with.lengthOf(4)\n```\nwhich is essentially equivalent to below, however the property may not exist:\n```javascript\nuser.pets.should.have.lengthOf(4)\n```\n\nour dummy getters such as _a_, _an_, _be_, _of_ and _have_ make tests more readable while the getters _and_ and _with_ helps express chaining:\n```javascript\nuser.should.be.an.instanceOf(Object).and.have.property('name', 'tj')\nuser.should.have.property('pets').with.a.lengthOf(4)\n```\nThose getters don't have any actual effect, just for readability.\n\n## static\n\nFor some rare cases should can be used statically, without `Object.prototype`.\nIt can be replacement for node assert module (and it uses the same `AssertionError`):\n\n```javascript\nassert.fail(actual, expected, message, operator) // just write wrong should assertion\nassert(value, message), assert.ok(value, [message]) // should(value).ok\nassert.equal(actual, expected, [message]) // should(actual).eql(expected, [message])\nassert.notEqual(actual, expected, [message]) // should(actual).not.eql(expected, [message])\nassert.deepEqual(actual, expected, [message]) // should(actual).eql(expected, [message])\nassert.notDeepEqual(actual, expected, [message]) // should(actual).not.eql(expected, [message])\nassert.strictEqual(actual, expected, [message]) // should(actual).equal(expected, [message])\nassert.notStrictEqual(actual, expected, [message]) // should(actual).not.equal(expected, [message])\nassert.throws(block, [error], [message]) // should(block).throw([error])\nassert.doesNotThrow(block, [message]) // should(block).not.throw([error])\nassert.ifError(value) // should(value).Error (to check if it is error) or should(value).not.ok (to check that it is falsy)\n```\n\n## ok\n\nAssert truthfulness:\n```javascript\ntrue.should.be.ok\n'yay'.should.be.ok\n(1).should.be.ok\n```\nor negated:\n```javascript\nfalse.should.not.be.ok\n''.should.not.be.ok\n(0).should.not.be.ok\n```\n## true\n\nAssert === true:\n```javascript\ntrue.should.be.true\n'1'.should.not.be.true\n```\n## false\n\nAssert === false:\n```javascript\nfalse.should.be.false\n(0).should.not.be.false\n```\n## arguments\n\nAssert `Arguments`:\n```javascript\nvar args = (function(){ return arguments; })(1,2,3);\nargs.should.be.arguments;\n[].should.not.be.arguments;\n```\n## empty\n\nAsserts that given object is empty\n```javascript\n[].should.be.empty\n''.should.be.empty\n({}).should.be.empty\n(function() {\n arguments.should.be.empty;\n})()\n```\n## eql\n\nequality:\n```javascript\n({ foo: 'bar' }).should.eql({ foo: 'bar' })\n[1,2,3].should.eql([1,2,3])\n```\n## equal and exactly\n\nstrict equality:\n```javascript\nshould.strictEqual(undefined, value)\nshould.strictEqual(false, value)\n(4).should.equal(4)\n'test'.should.equal('test')\n[1,2,3].should.not.equal([1,2,3])\n(4).should.be.exactly(4)\n```\n## within\n\nAssert inclusive numeric range:\n```javascript\nuser.age.should.be.within(5, 50)\n```\n## approximately\n\nAssert floating point number:\n```javascript\n(99.99).should.be.approximately(100, 0.1);\n```\n## type\n\nAssert __typeof__:\n```javascript\nuser.should.be.type('object')\n'test'.should.be.type('string')\n```\n## instanceof and instanceOf\n\nAssert __instanceof__ or __instanceOf__:\n```javascript\nuser.should.be.an.instanceof(User)\n[].should.be.an.instanceOf(Array)\n```\n## above\n\nAssert numeric value above the given value:\n```javascript\nuser.age.should.be.above(5)\nuser.age.should.not.be.above(100)\n```\n## below\n\nAssert numeric value below the given value:\n```javascript\nuser.age.should.be.below(100)\nuser.age.should.not.be.below(5)\n```\n## NaN\n\nAssert numeric valus is NaN:\n```javascript\n(undefined + 0).should.be.NaN;\n```\n## Infinity\n\nAssert numeric valus is Infinity:\n```javascript\n(1/0).should.be.Infinity;\n```\n## match\n\nAssert regexp match:\n```javascript\nusername.should.match(/^\\w+$/)\n```\n## length\n\nAssert _length_ property exists and has a value of the given number:\n```javascript\nuser.pets.should.have.length(5)\nuser.pets.should.have.a.lengthOf(5)\n({ length: 10}).should.have.length(10);\n```\nAliases: _lengthOf_\n\n## property\n\nAssert property exists and has optional value(compare using `===`):\n```javascript\nuser.should.have.property('name')\nuser.should.have.property('age', 15)\nuser.should.not.have.property('rawr')\nuser.should.not.have.property('age', 0)\n```\n\n## properties\n\nAssert given properties exists:\n```javascript\nuser.should.have.properties('name', 'age');\nuser.should.have.properties(['name', 'age']);\n```\n## ownProperty\n\nAssert own property (on the immediate object):\n```javascript\n({ foo: 'bar' }).should.have.ownProperty('foo')\n```\n## status(code)\n\n Asserts that `.statusCode` is `code`:\n```javascript\nres.should.have.status(200);\n```\n## header(field[, value])\n\n Asserts that a `.headers` object with `field` and optional `value` are present:\n```javascript\nres.should.have.header('content-length');\nres.should.have.header('Content-Length', '123');\nres.should.have.header('content-length', '123');\n```\n## json\n\n Assert that Content-Type is \"application/json; charset=utf-8\"\n```javascript\nres.should.be.json\n```\n## html\n\n Assert that Content-Type is \"text/html; charset=utf-8\"\n```javascript\nres.should.be.html\n```\n\n## include(obj) or contain(obj)\n\nAssert that the given `obj` is present via `indexOf()`, so this works for strings, arrays, or custom objects implementing indexOf. Also it can assert if given object will have some sub-object.\n\nAssert array value:\n```javascript\n[1,2,3].should.include(3)\n[1,2,3].should.include(2)\n[1,2,3].should.not.include(4)\n```\nAssert substring:\n```javascript\n'foo bar baz'.should.include('foo')\n'foo bar baz'.should.include('bar')\n'foo bar baz'.should.include('baz')\n'foo bar baz'.should.not.include('FOO')\n```\nAssert object includes another object:\n```javascript\nvar tobi = { name: 'Tobi', age: 1 };\nvar jane = { name: 'Jane', age: 5 };\nvar user = { name: 'TJ', pet: tobi };\n\nuser.should.include({ pet: tobi });\nuser.should.include({ pet: tobi, name: 'TJ' });\nuser.should.not.include({ pet: jane });\nuser.should.not.include({ name: 'Someone' });\n```\n## includeEql(obj)\n\nAssert that an object equal to the given `obj` is present in an Array:\n```javascript\n[[1],[2],[3]].should.includeEql([3])\n[[1],[2],[3]].should.includeEql([2])\n[[1],[2],[3]].should.not.includeEql([4])\n```\n## throw()\n\nAssert an exception is thrown:\n\n```js\n(function(){\n throw new Error('fail');\n}).should.throw();\n```\n\nAssert an exception is not thrown:\n\n```js\n(function(){\n\n}).should.not.throw();\n```\nAssert exception message matches string:\n\n```js\n(function(){\n throw new Error('fail');\n}).should.throw('fail');\n```\n\nAssert exepection message matches regexp:\n\n```js\n(function(){\n throw new Error('failed to foo');\n}).should.throw(/^fail/);\n```\n\n## throwError()\n\nAn alias of `throw`, its purpose is to be an option for those who run\n[jshint](https://github.com/jshint/node-jshint/) in strict mode.\n\n```js\n(function(){\n throw new Error('failed to baz');\n}).should.throwError(/^fail.*/);\n```\n\n## startWith(str)\n\nAssert that string starts with `str`.\n\n```javascript\n'foobar'.should.startWith('foo')\n'foobar'.should.not.startWith('bar')\n```\n## endWith(str)\n\nAssert that string ends with `str`.\n\n```javascript\n'foobar'.should.endWith('bar')\n'foobar'.should.not.endWith('foo')\n```\n\n## keys\n\nAssert own object keys, which must match _exactly_,\nand will fail if you omit a key or two:\n\n var obj = { foo: 'bar', baz: 'raz' };\n obj.should.have.keys('foo', 'baz');\n obj.should.have.keys(['foo', 'baz']);\n\n## type assertions\n\n```javascript\n({}).should.be.an.Object;\n(1).should.be.an.Number;\n[].should.be.an.Array;\n(true).should.be.a.Boolean;\n''.should.be.a.String;\n```\n\n## Optional Error description\n\nAs it can often be difficult to ascertain exactly where failed assertions are coming from in your tests, an optional description parameter can be passed to several should matchers. The description will follow the failed assertion in the error:\n\n (1).should.eql(0, 'some useful description')\n\n AssertionError: expected 1 to equal 0 | some useful description\n at Object.eql (/Users/swift/code/should.js/node_modules/should/lib/should.js:280:10)\n ...\n\nThe methods that support this optional description are: `eql`, `equal`, `within`, `a`, `instanceof`, `above`, `below`, `match`, `length`, `property`, `ownProperty`, `include`, and `includeEql`.\n\n## Mocha example\n\nFor example you can use should with the [Mocha test framework](http://visionmedia.github.io/mocha/) by simply including it:\n\n```javascript\nvar should = require('should');\nvar mylib = require('mylib');\n\n\ndescribe('mylib', function () {\n it('should have a version with the format #.#.#', function() {\n lib.version.should.match(/^\\d+\\.\\d+\\.\\d+$/);\n }\n});\n```\n\n## Running tests\n\nTo run the tests for _should_ simply run:\n\n $ make test\n\n## OMG IT EXTENDS OBJECT???!?!@\n\nYes, yes it does, with a single getter _should_, and no it won't break your code, because it does this **properly** with a non-enumerable property.\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2010-2011 TJ Holowaychuk <tj@vision-media.ca>\n\nCopyright (c) 2011 Aseem Kishore <aseem.kishore@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 36 36 "readmeFilename": "Readme.md", 37 37 "bugs": { 38 38 "url": "https://github.com/visionmedia/should.js/issues" 39 39 }, 40 "_id": "should@2.1. 0",40 "_id": "should@2.1.1", 41 41 "dist": { 42 "shasum": " 7bceb94366f4e87672f3ced74cc9f1561f234336"42 "shasum": "4a86e19fe38285785031d253938daedb169f72e5" 43 43 }, 44 "_from": "should@ ",45 "_resolved": "https://registry.npmjs.org/should/-/should-2.1. 0.tgz"44 "_from": "should@2.1.1", 45 "_resolved": "https://registry.npmjs.org/should/-/should-2.1.1.tgz" 46 46 } -
Dev/trunk/node_modules/should/should.js
r484 r516 189 189 }; 190 190 191 should.inspect = function(obj, opts) { 192 if(util.isDate(obj) && typeof obj.inspect !== 'function') obj = obj.toISOString(); 193 return inspect(obj, opts); 194 }; 191 should.inspect = inspect; 192 193 function i(value) { 194 if(util.isDate(value) && typeof value.inspect !== 'function') return value.toISOString(); //show millis in dates 195 return should.inspect(value); 196 } 195 197 196 198 /** … … 216 218 if(null == obj) { 217 219 throw new AssertionError({ 218 message: msg || ('expected ' + should.inspect(obj) + ' to exist')220 message: msg || ('expected ' + i(obj) + ' to exist') 219 221 , stackStartFunction: should.exist 220 222 }); … … 234 236 if (null != obj) { 235 237 throw new AssertionError({ 236 message: msg || ('expected ' + should.inspect(obj) + ' to not exist')238 message: msg || ('expected ' + i(obj) + ' to not exist') 237 239 , stackStartFunction: should.not.exist 238 240 }); … … 402 404 403 405 get inspect() { 404 return should.inspect(this.obj);406 return i(this.obj); 405 407 }, 406 408 … … 532 534 this.assert( 533 535 eql(val, this.obj) 534 , function(){ return 'expected ' + this.inspect + ' to equal ' + should.inspect(val) + (description ? " | " + description : "") }535 , function(){ return 'expected ' + this.inspect + ' to not equal ' + should.inspect(val) + (description ? " | " + description : "") }536 , function(){ return 'expected ' + this.inspect + ' to equal ' + i(val) + (description ? " | " + description : "") } 537 , function(){ return 'expected ' + this.inspect + ' to not equal ' + i(val) + (description ? " | " + description : "") } 536 538 , val 537 539 , true … … 551 553 this.assert( 552 554 val === this.obj 553 , function(){ return 'expected ' + this.inspect + ' to equal ' + should.inspect(val) + (description ? " | " + description : "") }554 , function(){ return 'expected ' + this.inspect + ' to not equal ' + should.inspect(val) + (description ? " | " + description : "") }555 , function(){ return 'expected ' + this.inspect + ' to equal ' + i(val) + (description ? " | " + description : "") } 556 , function(){ return 'expected ' + this.inspect + ' to not equal ' + i(val) + (description ? " | " + description : "") } 555 557 , val 556 558 , void 0 … … 804 806 if (this.negate && undefined !== val) { 805 807 if (undefined === this.obj[name]) { 806 throw new Error(this.inspect + ' has no property ' + should.inspect(name) + (description ? " | " + description : ""));808 throw new Error(this.inspect + ' has no property ' + i(name) + (description ? " | " + description : "")); 807 809 } 808 810 } else { 809 811 this.assert( 810 812 undefined !== this.obj[name] 811 , function(){ return 'expected ' + this.inspect + ' to have a property ' + should.inspect(name) + (description ? " | " + description : "") }812 , function(){ return 'expected ' + this.inspect + ' to not have a property ' + should.inspect(name) + (description ? " | " + description : "") }813 , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name) + (description ? " | " + description : "") } 814 , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + (description ? " | " + description : "") } 813 815 , void 0 814 816 , void 0 … … 819 821 this.assert( 820 822 val === this.obj[name] 821 , function(){ return 'expected ' + this.inspect + ' to have a property ' + should.inspect(name)822 + ' of ' + should.inspect(val) + ', but got ' + should.inspect(this.obj[name]) + (description ? " | " + description : "") }823 , function(){ return 'expected ' + this.inspect + ' to not have a property ' + should.inspect(name) + ' of ' + should.inspect(val) + (description ? " | " + description : "") }823 , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name) 824 + ' of ' + i(val) + ', but got ' + i(this.obj[name]) + (description ? " | " + description : "") } 825 , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + ' of ' + i(val) + (description ? " | " + description : "") } 824 826 , void 0 825 827 , void 0 … … 855 857 if (len > 1) { 856 858 names = names.map(function(name){ 857 return should.inspect(name);859 return i(name); 858 860 }); 859 861 var last = names.pop(); 860 862 str = names.join(', ') + ', and ' + last; 861 863 } else { 862 str = should.inspect(names[0]);864 str = i(names[0]); 863 865 } 864 866 … … 885 887 this.assert( 886 888 hasOwnProperty.call(this.obj, name) 887 , function(){ return 'expected ' + this.inspect + ' to have own property ' + should.inspect(name) + (description ? " | " + description : "") }888 , function(){ return 'expected ' + this.inspect + ' to not have own property ' + should.inspect(name) + (description ? " | " + description : "") }889 , function(){ return 'expected ' + this.inspect + ' to have own property ' + i(name) + (description ? " | " + description : "") } 890 , function(){ return 'expected ' + this.inspect + ' to not have own property ' + i(name) + (description ? " | " + description : "") } 889 891 , void 0 890 892 , void 0 … … 903 905 startWith: function(str, description) { 904 906 this.assert(0 === this.obj.indexOf(str) 905 , function() { return 'expected ' + this.inspect + ' to start with ' + should.inspect(str) + (description ? " | " + description : "") }906 , function() { return 'expected ' + this.inspect + ' to not start with ' + should.inspect(str) + (description ? " | " + description : "") }907 , function() { return 'expected ' + this.inspect + ' to start with ' + i(str) + (description ? " | " + description : "") } 908 , function() { return 'expected ' + this.inspect + ' to not start with ' + i(str) + (description ? " | " + description : "") } 907 909 , void 0 908 910 , void 0 … … 920 922 endWith: function(str, description) { 921 923 this.assert(-1 !== this.obj.indexOf(str, this.obj.length - str.length) 922 , function() { return 'expected ' + this.inspect + ' to end with ' + should.inspect(str) + (description ? " | " + description : "") }923 , function() { return 'expected ' + this.inspect + ' to not end with ' + should.inspect(str) + (description ? " | " + description : "") }924 , function() { return 'expected ' + this.inspect + ' to end with ' + i(str) + (description ? " | " + description : "") } 925 , function() { return 'expected ' + this.inspect + ' to not end with ' + i(str) + (description ? " | " + description : "") } 924 926 , void 0 925 927 , void 0 … … 942 944 this.assert( 943 945 eql(cmp, obj) 944 , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }945 , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }946 , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + i(obj) + (description ? " | " + description : "") } 947 , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + i(obj) + (description ? " | " + description : "") } 946 948 , void 0 947 949 , void 0 … … 950 952 this.assert( 951 953 ~this.obj.indexOf(obj) 952 , function(){ return 'expected ' + this.inspect + ' to include ' + should.inspect(obj) + (description ? " | " + description : "") }953 , function(){ return 'expected ' + this.inspect + ' to not include ' + should.inspect(obj) + (description ? " | " + description : "") }954 , function(){ return 'expected ' + this.inspect + ' to include ' + i(obj) + (description ? " | " + description : "") } 955 , function(){ return 'expected ' + this.inspect + ' to not include ' + i(obj) + (description ? " | " + description : "") } 954 956 , void 0 955 957 , void 0 … … 970 972 this.assert( 971 973 this.obj.some(function(item) { return eql(obj, item); }) 972 , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }973 , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }974 , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + i(obj) + (description ? " | " + description : "") } 975 , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + i(obj) + (description ? " | " + description : "") } 974 976 , void 0 975 977 , void 0 … … 1010 1012 if (len > 1) { 1011 1013 keys = keys.map(function(key){ 1012 return should.inspect(key);1014 return i(key); 1013 1015 }); 1014 1016 var last = keys.pop(); 1015 1017 str = keys.join(', ') + ', and ' + last; 1016 1018 } else { 1017 str = should.inspect(keys[0]);1019 str = i(keys[0]); 1018 1020 } 1019 1021 … … 1059 1061 this.assert( 1060 1062 code == status 1061 , function(){ return 'expected response code of ' + code + ' ' + should.inspect(statusCodes[code])1062 + ', but got ' + status + ' ' + should.inspect(statusCodes[status]) }1063 , function(){ return 'expected to not respond with ' + code + ' ' + should.inspect(statusCodes[code]) });1063 , function(){ return 'expected response code of ' + code + ' ' + i(statusCodes[code]) 1064 + ', but got ' + status + ' ' + i(statusCodes[status]) } 1065 , function(){ return 'expected to not respond with ' + code + ' ' + i(statusCodes[code]) }); 1064 1066 1065 1067 return this;
Note: See TracChangeset
for help on using the changeset viewer.